Skip to main content

Project logging printout

Project description

loguru-notification

loguru-notification 是一个日志输出项目,在loguru的基础集成日志输出到控制台、输出到Slack、并结合CMRESHandler把日记记录到ElasticSearch, 更容易的对日志进行分析。

Installation

1.使用python包管理工具pip 进行安装。

pip install loguru-notification

Usage

对loguru-notification进行配置,并输出日志信息。

from configlog.setlogs import Logger

logger = Logger(
    dsn='Your Sentry URL',  # Sentry dsn URL
    webhook_url='Your Slack webhook URL',  # Slack webhook URL  # noqa
    es_host='172.0.0.1:9200',  # log on ElasticSearch host ip and port
)

if __name__ == '__main__':
    logger.printout('输出到控制台')
    logger.msg('输出到控制台,并写入ElasticSearch')
    logger.notice('输出到控制台和Slack,并写入ElasticSearch')

Contributing

欢迎使用,如果有好的优化方法也欢迎提交修改。

使用前请做适当的测试,以确定跟您的项目完全兼容。

License

MIT

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

loguru-notification-0.0.4.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

loguru_notification-0.0.4-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page