实现对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.20040217.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f24e1a96efc347e4f4667329b6a82fd0eaf31df52d81ef3638a3642187268d2 |
|
MD5 | 5761e7f742da4437dea06883567ab76c |
|
BLAKE2b-256 | 6d12d270a456364efd679cbda0ce8c3c560c2a7d603f9472421c5b915fca8459 |
Close
Hashes for logger_app-0.0.1.20040217-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 907ff38056c63cbf7f2c43bcd3b24ab38ef2eea060552003b401226f068cb6c4 |
|
MD5 | 78f942b0fa184ffea1b2d4205e6f07dd |
|
BLAKE2b-256 | 30bd44c1ffc19d1baae93cc9a19a89401d4be021b0797f5977ce24aed445adc3 |