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 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.2.tar.gz (2.5 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.2-py2.py3-none-any.whl (3.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: loguru-notification-0.0.2.tar.gz
  • Upload date:
  • Size: 2.5 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.2.tar.gz
Algorithm Hash digest
SHA256 e16929ea35c0f886ab7255faf7f7afafb3007fed9fb86df74095c02a8293fde3
MD5 23ae2a3c52bdcd8c2b19a4f40fe3b4b0
BLAKE2b-256 40e961c3de6c7e070e126084dd9a457e4b62b548d49afefe7e31058819176742

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loguru_notification-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cb2934163b8cb04f85cdad4b32369525129e5504318088df7299567d99df28d4
MD5 65c0a7d19ba9992deeca958687d8c203
BLAKE2b-256 97c299d06ed1da4222b6431699d65961d192790c61503edeaba36ec7ec496e8f

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