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.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b427ad258b7bc4fd1e545b208861ce642d662bb9773fcc2c303b06d628210ed4 |
|
MD5 | 3bfdb913de1af362d2012aa6e0152ae7 |
|
BLAKE2b-256 | 30e93775f2590ccd7913ea3b8cf28c57ec926d628492a720cd7ed77fa907dac4 |