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.5.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.5-py2.py3-none-any.whl (6.3 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: loguru-notification-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 3fa169d96bcf97107c49fe7c3207c3bacfa29c6ec2c5e18bfc597be3f3315785
MD5 699d1920b80080021b5d7761b80fbdf4
BLAKE2b-256 bb311e043b12a22d2ffcb3e8a680bd93f8a1094d8f28445f4f74858242ba3cc9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loguru_notification-0.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 abe148166de7cf682f074b16d28d86ec0c3fc2158999de72bb5a1c1f36b43e57
MD5 87c703bdb46a51cb7fba13bafd87891a
BLAKE2b-256 0fa38153b5e3dae0f54a4756014a7f3039ae9a3839206abeac1d4a7be315aef6

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