Skip to main content

A simple, yet powerful Python logging library that makes you say goodbye to your standard logger.

Project description

ByeByeLogger

Oh, great! Another logging package, because obviously, we need more of those, right? Well, let me introduce you to ByeByeLogger, the one that's going to make you say goodbye to your current logger (whether you like it or not).

Installation

To get this totally groundbreaking package, just do the usual pip dance:

pip install byebyelogger

Features

  • Create simple loggers with just a few lines of code
  • Customize log output with colors, formats, and callables
  • Easily integrate with existing codebases

Example Usage

Simple Logger

Create a simple logger with a custom color and level:

from byebyelogger import single_logger
from byebyelogger.style.color import RED
from byebyelogger.style.format import SQUARE_BRACKETS

logger = single_logger(RED, "INFO", SQUARE_BRACKETS)
logger.log("This is an example message.")

Output:

[INFO] This is an example message.

Nested Logger

from byebyelogger import nested_logger
from byebyelogger.style.color import LIGHTCYAN_EX
from byebyelogger.style.format import SQUARE_BRACKETS
from datetime import datetime

def timestamp_func():
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S")

components = [
    (timestamp_func, SQUARE_BRACKETS),
    ("SQLITE", SQUARE_BRACKETS),
    (LIGHTCYAN_EX("INFO"), None),
]

logger = nested_logger(components)
logger.log("This is an example message.")

Output:

[2023-01-01 01:00:00] [SQLITE] INFO This is an example message.

Documentation

For more detailed information on how to use ByeByeLogger, please refer to the inline documentation in the package files:

  • logger.py
  • core/configuration.py
  • core/stack_info.py
  • style/color.py
  • style/format.py

License

ByeByeLogger is released under the MIT License.

Contributing

We welcome contributions to ByeByeLogger! If you'd like to contribute, please fork the repository and submit a pull request. We'll review your changes and merge them in if everything looks good.

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

ByeByeLogger-3.0.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

ByeByeLogger-3.0.0-py3-none-any.whl (6.8 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