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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

File details

Details for the file loguru-notification-0.0.4.tar.gz.

File metadata

  • Download URL: loguru-notification-0.0.4.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for loguru-notification-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d7a904cc83b9a8a50782fd4573cc147baca45bc88d12191b81de69cbe45170a3
MD5 562706ff1f620559963e6ac0c83917e8
BLAKE2b-256 5545ba8c9624ed3c7b5ffba460da5125b129a53ab1c8f799220a756e1318e979

See more details on using hashes here.

File details

Details for the file loguru_notification-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: loguru_notification-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for loguru_notification-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6cc10fea89fd7d03749fd49e0c74c9427d8e2ed1af5d154b41efefba48938030
MD5 ef6fd8a276213d2e3f4e5f1cf747680c
BLAKE2b-256 631c46b1b059201826cddb83895cca7810b59df719d8af719b75618a96486b51

See more details on using hashes here.

Supported by

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