My logging improvement
Project description
BetterLogging
Improved version of the standard logger.
- Added
TRACE
level. - Added
ColorizedFormatter
. - Added better traceback formatting.
This package patching the standard logging
library.
Thus, after import, all improvements will be available inside the logging
module.
But for better typing, I prefer to use betterlogging
everywhere.
Requirements
Python 3.6 and above. No any additional dependencies.
Installation
pip install betterlogging
Usage
import betterlogging as logging
logger = logging.getLogger("test")
handler = logging.StreamHandler()
handler.setFormatter(logging.ColorizedFormatter())
logger.addHandler(handler)
logger.setLevel(logging.TRACE)
logger.trace("some trace message")
logger.debug("some debug message")
logger.info("some info message")
logger.warning("some warning message")
logger.error("some error message")
logger.critical("some critical message")
try:
a = 1/0
except:
logger.exception("Some exception")
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
betterlogging-0.0.5.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for betterlogging-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7026cf12813f86349a604aa258914a6cf285bf84617e176cfbbf7202375cfc58 |
|
MD5 | c74439498f09dd4b3d722edeab2162a0 |
|
BLAKE2b-256 | 780e2a8386d241ba1ce0da56cc634f2680636dc3fcf5bd3b5b38b3639b165cdc |