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
File details
Details for the file nice_logging-1.1.1.tar.gz
.
File metadata
- Download URL: nice_logging-1.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb2486f7838c705cb5ac43beabb74b34890e6a2844a4d9f1785cf97afecfea6 |
|
MD5 | 7872299b4cb99904267d71ff30a36c60 |
|
BLAKE2b-256 | eebd3c4bf3ae40618a15b28cc5eda6879bea224eb399c02de9f99b7f36c8a5f7 |
File details
Details for the file nice_logging-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: nice_logging-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | beb487aadbb25db117fae90374add6f2645da2450a9e6376150c2e1a693e2952 |
|
MD5 | 66db14a6a0ecdf67c70c58eda0644576 |
|
BLAKE2b-256 | 00fcea9ff63be1943cca44df7769dd9c752e238bf3132046c5b91e525119c40c |