Skip to content

Configure Python logging in one line: configure_logging()

Notifications You must be signed in to change notification settings

Dmitrii-I/logging_configurator

Repository files navigation

logging_configurator

Tests status badge PyPI version

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

Installation

pip install logging_configurator

Examples

Log using defaults: INFO to stdout/stderr

from logging_configurator import configure_logging
configure_logging()

Log 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, delete contents first

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

Publishing to PyPI

git checkout <tag>
python -m build
twine check dist/*
twine upload dist/*
git checkout master