A logging toolkit
Project description
python-xlogs
logging toolkit
install
pip install xlogs
Usage
Use as decorator
from xlogs import log
if __name__ == '__main__':
# config_file: the logging config template, use the default if None
@log(log_file='./logs',config_file=None)
def division():
pass
load ini config file
from xlogs import Log
import logging
if __name__ == '__main__':
Log(config_file= '/xxx.ini', log_file = '/xxx/')
logging.info('Default load to root')
info = logging.getLogger('root')
info.info('write msg to test.log')
info = logging.getLogger('test')
info.info('write msg to test.log')
info = logging.getLogger('info')
info.info('write msg to info.log')
error = logging.getLogger('error')
error.error('write msg to error.log')
# reload a new config file
Log(config_file= '/yyy.ini', log_file = '/yyy/').log_reset()
logging.getLogger().info("info with new logger")
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
xlogs-1.0.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for xlogs-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b60fd0fa1dfb19f3248066a5fab0d058d0711751f41c07550f148d54e0e85faf |
|
MD5 | e1490f2ab3eaae925712656ca162b981 |
|
BLAKE2b-256 | 56926170d2448d4db849efdafd1e0a6e8c6b4670322d1fa24434924753c32cad |