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.6.tar.gz (5.3 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.6-py2.py3-none-any.whl (6.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for loguru-notification-0.0.6.tar.gz
Algorithm Hash digest
SHA256 b87bfa3d5c40a81f3a5656f28cf4dbb3f826b9edc8b9ba7d410f8b44d020e56a
MD5 4ab2a80c53b1a07b8234b7d94b45a929
BLAKE2b-256 f6034247ea4de7f7bd3d5a1b77fa244ee4c1581e1dc0a739c4a0c9f3accee403

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loguru_notification-0.0.6-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/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.6

File hashes

Hashes for loguru_notification-0.0.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c23484fe950e1917c124361efb871d887a2217d8d40947f756be4b1f7f87b830
MD5 1a4e53cb84b5959f9a0304cd4565c80c
BLAKE2b-256 1603c2fda38dc8fae96b5815493c02d9de72589b67b406dadf9caa1487e62601

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