VT100 logging for Python
Project description
vt100logging
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)
Built Distribution
Close
Hashes for vt100logging-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fba5be4c9e5e5e7c7ae331c69693110b77047946fe0dc680747526d3de623151 |
|
MD5 | e0180440d38b2fe3ff163cdec174a7ec |
|
BLAKE2b-256 | 876886b2e7bcf1d3c50e46953d6fa1f4bcf6985191e6a85f5e317db95e5bbde4 |