logging-configurator

One-liner logging configurator for Python.


Keywords
logging, python
License
MIT
Install
pip install logging-configurator==2.0.0

Documentation

logging_configurator

Tests status badge PyPI version

Configure logging with one line (not counting the import).

Configure logging using defaults (log INFO to stdout/stderr, but not to a log file):

from logging_configurator import configure_logging
configure_logging()

Logging to a file and to stdout/stderr:

from logging_configurator import configure_logging
configure_logging(path="foo.log", stdout_and_stderr=True)

Log to a file and if file exists, delete its contents first:

from logging_configurator import configure_logging
configure_logging(path="foo.log", append=False)