Just a simple script to create a logger object for logging to console
Project description
hns_console_logging
Just a simple script to create a logger object for logging to console. It is intended to be used with services running as docker container. By using the logging facility in docker container, you don't need to write logs to the file, you can use the logs written to file by docker daemon.
Installation
pip install hns-console-logging
Usage
import hns_console_logging
logger = hns_console_logging.get_logger('test_module')
logger.info('Info msg')
You can change the default log format and log level.
Default log format: %(asctime)s %(levelname)s %(name)s %(funcName)s [PID:%(process)d TID:%(thread)d] %(message)s
Default log level: INFO
Default formatter class: logging.Formatter
To change log format, please refer: https://docs.python.org/3/library/logging.html#logrecord-attributes
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 hns_console_logging-20.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 769fc2ed9e5eb39a83643393f794aeb02419e57792d03510f7a3e68ea87ea5bf |
|
MD5 | 373802b355bb1943d7b9010ac17ed189 |
|
BLAKE2b-256 | 247b1ca976fbc64754fda18ba271f2888ddb00fb281ffacc0596a4994a658953 |