Simple logging library with colored and timestamped output by default
Project description
nice_logging
Simple logging library that has colored and timestamped output by default. Can be used as a drop-in replacement.
Installation
pip install nice_logging
(Or just grab the .py file)
Usage
import nice_logging
nice_logging.basicConfig(level=nice_logging.DEBUG)
logger = nice_logging.getLogger(__name__)
logger.info("Hello")
2023-07-23 11:27:33,571 [INFO ] [__main__] Hello
Or:
import nice_logging as logging
Structured Logging
nice_logging has support for rudimentary structured logging. If you use getStructuredLogger
instead of getLogger
(or instantiate a StructuredLogger
), you will get a logger whose log functions take a single message, and any number of keyword arguments, which are aggregated in a single dict. The resulting LogRecord
will have the attribute structured
set to True
, and structured_data
to the dict.
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
Built Distribution
Hashes for nice_logging-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | beb487aadbb25db117fae90374add6f2645da2450a9e6376150c2e1a693e2952 |
|
MD5 | 66db14a6a0ecdf67c70c58eda0644576 |
|
BLAKE2b-256 | 00fcea9ff63be1943cca44df7769dd9c752e238bf3132046c5b91e525119c40c |