Skip to main content

An opinionated logger and configuration system.

Project description

Lavender Logging

Lavender Logging is a logger configuration system designed to simplify the process of configuring your logger to only log the messages you want to see.

Usage

To use Lavender simply call lavender.setup() instead of logging.basicConfig(). This will enable all of Lavender's features and ensure it works as intended.

Lavender uses its own filter system, configured using patterns which match package names. For example discord.* matches all submodules of the discord package. Filters can be added using the filter_config parameter of lavender.setup or using environment variables.

Lavender looks for evironment variables with LOG_DEBUG, LOG_INFO, LOG_WARNING etc to extract patterns from. Multiple patterns can be specified for the same log level by separating them with os.pathsep. For example, the following will set the log level of amethyst.client and all submodules of discord and to ERROR on windows.

LOG_ERROR="amethyst.client;discord.*"

Filters that infer more of a package's path with wildcards have less priority over more specific patterns. For example with the patterns discord.* and discord.gateway.*, discord.gateway.* will have priority.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lavender_logging-1.0.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

lavender_logging-1.0.0-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page