Dmitrii-I / logging_configurator

Configure Python logging in one line: configure_logging()

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Configure Python logging in one line: configure_logging()


Languages

Language:Python 82.9%Language:Shell 17.1%