实现对logging的简单扩展
Project description
Documentation
The documentation is hosted at https://github.com/BingerYang/logger_app
Installation
pip install logger_app
Usage
example:
# -*- coding: utf-8 -*- from logger_app import FormatterRule, LoggerApp from flask import request, Flask app = Flask(__name__) app.config['PROPAGATE_EXCEPTIONS'] = False # 设置是否传递异常 , 如果为True, 则flask运行中的错误会显示到网页中, 如果为False, 则会输出到文件中 # FormatterRule.CB_TAG_MAP = dict(path=lambda: request.path, md5=lambda: request.host_url) @app.route('/') def index(): # num = 1 / 0 app.logger.error('this is a error') return "index" if __name__ == '__main__': app.logger = LoggerApp(__name__, fmt=FormatterRule(style='json')).create_logger() app.run(debug=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for logger_app-0.0.1.20061114.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52ad4978adf4f5f795fe23a7f99deb96f31b6cc31e39499b03ce5cd8c62a95db |
|
MD5 | e8a3fbe1ccaeb9e368e9e909d78485ab |
|
BLAKE2b-256 | c341823d807e39b7b25e6900402d53d55ad7c6d1026e6abb7e9203c964e0ab70 |
Close
Hashes for logger_app-0.0.1.20061114-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7774e5e48c17c23d8347feaf9d9bad6668be121c43ae487aa91168559e2ec36 |
|
MD5 | f1e80b0a9d268766aa6b7846d438f4c1 |
|
BLAKE2b-256 | e1d0fd179c3edf96ac4ccb20e9b354e8b9e77f2319a865eeaa929c894f94a4a2 |