Skip to main content

Flask extension of loguru

Project description

Flask-loguru

Build Status
Coverage Status
将loguru改造成flask扩展

安装方式

python setup.py install

配置参数介绍

参数 介绍 实例
LOG_PATH log输出路径 /home/work/log/web
LOG_NAME log输出的文件名称 run.log
LOG_FORMAT log输出格式 {time:YYYY-MM-DD at HH:mm:ss}
LOG_ROTATION log文件翻转时间(秒) 3600

扩展安装方式

from flask import Flask
from flask_loguru import Logger

app = Flask(__name__)

log = Logger()

log.init_app(app, {
    "LOG_PATH": "/home/work/www/log",
    "LOG_NAME": "run.log"
})

使用方法

from flask_loguru import logger

logger.critical("Critical Hello world")

logger.error("Fail Hello world")

logger.warning("Warning Hello world")

logger.info("Info Hello world")

logger.debug("Debug Hello world")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_loguru-1.0.0.tar.gz (5.2 kB view hashes)

Uploaded source

Built Distribution

flask_loguru-1.0.0-py2.py3-none-any.whl (7.5 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page