Skip to content

Python logging framework configurator for simultaneous file and shell logging

License

Notifications You must be signed in to change notification settings

rlipperts/logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log configurator

Simple configurator for the python logging package that allows simultaneous file and shell logging

installation

The log configurator can easily be installed from pypi

pip install log-configurator

usage

Import the package and the default python logging

import log_configurator
import logging

Configure python logging

log_configurator.setup_root_logger()

Create a logging instance in your module as usual and log with it

logger = logging.getLogger(__name__)
logger.info('Log Horizon')

buffer initial output

If you need more complex argument parsing before you can configure the logger you can buffer it and have it logged once you configure your logger.

initial_log = log_configurator.buffer_log()
logger = logging.getLogger(__name__)
logger.info('Early log information')

# <your setup code goes here>

log_configurator.setup_root_logger()
logger.debug(initial_log.getvalue())

The early log output currently can only be logged with one severity level.

About

Python logging framework configurator for simultaneous file and shell logging

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages