Sweet Logs

https://img.shields.io/pypi/v/sweet_logs.svg Documentation Status

A collection of logging formatters, filters, and functions. Original inspiration came from mCoding’s video on logging in Python.

Features

Utilizing the sweet_logs package can be as simple as importing it and running the setup function. This will configure the root logger to us the JSONFormatter and log to the console via sys.stdout.

import sweet_logs

sweet_logs.setup_logging()

logger = logging.getLogger(__name__)
logger.info('This is an info message')

The setup_logging function can take a few arguments to customize the logging configuration. What is passed to the config option is passed to the logging.config.dictConfig function.

Credits

This package was created with Cookiecutter and the jorwoods/cookiecutter-pypackage project template.