跳转到主要内容

作为上下文管理器处理日志级别的上下文管理器。

项目描述

日志作为上下文管理器。

Credo的外观得到视觉启发,我总是发现很难在命令行界面与用户交流。因此,这是一个更基于块而非基于行的日志/打印系统,并且带有颜色。

以下将显示一个格式良好的消息

with Message('Hello there') as log:
    log('This is a Logging message context manager')
    log('it support nesting and will render in a User friendly way')
    log('I need to fix multi \nline \nstring')

你可以嵌套这些

with Message('Hello there') as log:
    log('This is a Logging message context manager')
    log('it support nesting and will render in a User friendly way')
    log('I need to fix multi \nline \nstring')
    with Warning('Nested it does support') as log1:
        log1('like Yoda speach order ')
        log1('of words are')

    with Critical('Come to the dark side') as log2:
        log2('we have cookies')

        with OK("Paternity test") as log3:
            log3('I am your father')

以获取嵌套消息

项目详情


下载文件

为您的平台下载文件。如果您不确定要选择哪一个,请了解更多关于安装包的信息。

源分布

此版本没有可用的源分布文件。请参阅生成分布存档的教程

构建分布

withlog-0.0.3-py2.py3-none-any.whl (10.5 kB 查看哈希)

上传时间: Python 2 Python 3

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页