实现对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.20032317.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91b0ac48fdf210eb56a6d95c2341c666cf32d2928f018c479471435f1f7ed6c7 |
|
MD5 | ab5cd04dc6fb231bdcc36fa552ea990c |
|
BLAKE2b-256 | a12a069c340770cacf68c386ec1ca33f56f333bd52c6738a28eef87c3c7efde0 |
Close
Hashes for logger_app-0.0.1.20032317-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ac7a2cb755f2bafb95be67528fd08bf8b60a841049ea687291bee87ee49c0ca |
|
MD5 | 6dcc27db173b12faddce2227c1cdfe52 |
|
BLAKE2b-256 | 84cb3e0a96d9c03bf5a0ece8c594559cb71cc5b7f0e8289ad3e0a336416539fb |