A straightforward and lightweight logging and tracing library
Project description
Clearcut: A straightforward and lightweight logging wrapper library
This provides some helpful wrapper and util functions for logging, and formats log messages in a more human-readable way by default.
Use
At the top of the file:
from clearcut import get_logger
...
logger = get_logger(__name__)
Logging can be performed ad-hoc:
logger.info("info log")
logger.warning("warn log", exc_info=e)
"log blocks" can also be created which automatically log entrance/exits as well as performance information
from clearcut import log_block, get_logger
...
logger = get_logger(__name__)
...
with log_block("block name", logger):
...
TODO
- Would like to use contextvars to create a contextmanager where additional "metadata" can be specified (and unspecified) which would be included with logging automatically. (may not be import with OTLP tracing.)
- json logging
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
clearcut-0.2.0.post1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for clearcut-0.2.0.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0abd011ae25233c7164c8e2bbb0c2243c8cbf33bd2b8e7973626e5a16767b00 |
|
MD5 | 85f236443f7f46f40e23c2bf98878884 |
|
BLAKE2b-256 | a110cd89e5934e8fd1547c342ee7549f9020a6b332a836373abba1c32f14ea70 |