Skip to main content

Project logging

Project description

exec-log

exec-log 是一个日志输出项目,在loguru的基础集成日志输出到控制台、输出到Slack、并结合CMRESHandler把日记记录到ElasticSearch, 更容易的对日志进行分析。

Installation

1.使用python包管理工具pip 进行安装。

pip install exec-log

Usage

对exec-log进行配置,并输出日志信息。

from execlog.setlogs import Logger

logger = Logger(
    webhook_url='Your Slack webhook URL',  # Slack webhook URL  # noqa
    es_hosts=['172.0.0.1:9200'],  # log on ElasticSearch host ip and port
)

if __name__ == '__main__':
    logger.echo('输出到控制台')
    logger.info('输出到控制台,并写入ElasticSearch或本地')
    logger.app("发送到Slack")
    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

exec-log-0.1.1.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

exec_log-0.1.1-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

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