Skip to main content

A context manager to deal with logging level as context manager.

Project description

Logging as a context manager.

Visually inspired by how Credo looks like, I always find difficult to communicate with user in command line interface. So this is a logging/printing system which is more block based than line base, and with color also.

The following will show a nice formatted message :

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')

You can nest these:

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')

To get nested messages:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

withlog-0.0.2-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file withlog-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for withlog-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 168b8afea114aebd79cd910212297a215068427d9c9a81b49829ce39f95fd857
MD5 a0d63b23c1ce42933d8a1b9c61b21e08
BLAKE2b-256 70defbacd671f5ff603d25c2d51648a480f13af8c425125f4755c64673119794

See more details on using hashes here.

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