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


Release history Release notifications

Download files

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

Files for flask-loguru, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size flask_loguru-1.0.0-py2.py3-none-any.whl (7.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size flask_loguru-1.0.0.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page