Skip to main content

VT100 logging for Python

Project description

vt100logging

License: MIT

example log feed

The original logging package lacks basic coloring of the log output. This does not help when one tries to quickly check on the real time console feed.

vt100logging is a simple wrapper around logging. Using VT100 escape codes it colors the log feed.

Supported OS

Tested on MS Win11 and Ubuntu.

Installation

pip install -U vt100logging

How to use it

Simple use case

from vt100logging import vt100logging_init, D, I, W, E

vt100logging_init('LOGGED-MODULE', is_verbose=True)

D('example DEBUG message')
I('example INFO message')
W('example WARNING message')
E('example ERROR message')

Extract more information from exception

from vt100logging import EX

...
except Exception as e:
    EX(e)
...

Store log into file on the side:

from vt100logging import vt100logging_init, I

vt100logging_init('my-module', store_to_log_file=True)

I("Logging both to console AND log file")

Contribution

If something is wrong, you can raise issues here.

Copyright

Created by Grzegorz Grzęda. Distributed under MIT license

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

vt100logging-1.1.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

vt100logging-1.1.0-py3-none-any.whl (3.8 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