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

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: loguru-notification-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 a4a0be6ee1524d60cea0ee5cd3a28d65790a04cfed36e8712a33599f17338cde
MD5 bd0510715f0b6131bfa0abb3cd05c338
BLAKE2b-256 84805b3f726961b26ba8512fd0515889bee347cff28b8ba2c864bb0c6127a818

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loguru_notification-0.0.3-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.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7b40fa91f1b6670f76dc569c6f3b3a2065d7dc7f73a12fb5cbc922608bc65a52
MD5 67bc4f1b21519a275a54b3e85d5c6087
BLAKE2b-256 43fbf259c2f1406abd8069814e40e9650d11ef8d234f463eb375cccad961eb24

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