实现对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.20032618.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59e4a49b4002b976197c9c3b1c2f019204e3d4454cbc7ec3a4afe5c153031adf |
|
MD5 | 6cafcb60043561360cbb86c43d7d0f09 |
|
BLAKE2b-256 | 4ebf9c0d676d3032329592fba7b03349b719a357855cc08e73cf7bcb6f077eb0 |
Close
Hashes for logger_app-0.0.1.20032618-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93d96c0bf06ceda2a80c0a253dd4e03583acfa828775cca55d7bd1836680455c |
|
MD5 | 3d789172cdc7f8d757788ce99bc520af |
|
BLAKE2b-256 | 7e387ff3099c529e4b82efd1ef54db4df94f4cd10d96637e051c06f4eb7f7715 |