loguru packaging log tools
Project description
简介
loguru 基础上封装的 开封即用的 python 工具包 loguru doc https://loguru.readthedocs.io/en/stable/overview.html#installation
使用方法
pip install mlogs
from mlogs import MLogger
L = MLogger()
L.info("nice")
# request_id 可以用来 链路追踪, topic 用于分类
L.warning("nice", request_id="12312321", topic="model:task")
# MLogger 会同时输出日志到 terminal 日志文件
# FileLogger 仅输出日志到 日志文件,按照日志级别生成 不同的日志文件
# StdoutLogger 仅输出日志到 terminal
# AdaptHistoryLogger 为了兼容历史项目日志
一些介绍
- FileLogger 默认按照 50 MB分割文件,最多储存 10 个文件,默认不压缩日志。
- 日志级别默认为DEBUG,可以自定义设置,也可以使用环境变量 export DEPLOYMENT=PRODUCTION,设置日志级别为 INFO
todo
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
mlogs-0.0.10.tar.gz
(5.0 kB
view hashes)
Built Distribution
mlogs-0.0.10-py3-none-any.whl
(11.6 kB
view hashes)