A logging utility for Python applications with customizable intensity
Project description
Intensity Logger
A simple and flexible logging module with customizable intensity and color-coded output for enhanced readability.
Table of Contents
Introduction
Intensity Logger is a Python logging module designed to provide simple, color-coded logging output with customizable intensity. It helps to easily distinguish different log levels, such as debug, info, warning, error, success, and ratelimit.
Features
- Color-coded log messages for easy readability.
- Support for different log levels: debug, info, warning, error, success, and ratelimit.
- Optional custom intensity to convert messages to uppercase.
- Lightweight and easy to integrate into any Python project.
Installation
You can install Intensity Logger via pip:
pip install intensity-logger==0.1.2
Usage
Basic Usage
Here's a basic example to get you started with Intensity Logger:
from intensity_logger import Logger
logger = Logger()
logger.debug("This is a debug message.")
logger.info("This is an info message.")
logger.warning("Warning issued.")
logger.error("An error has occurred.")
logger.success("Operation was successful.")
logger.ratelimit("Rate limit exceeded.")
Log Levels
Intensity Logger supports various log levels, each with a different color:
- Debug: Detailed information, typically of interest only when diagnosing problems.
- Info: Confirmation that things are working as expected.
- Warning: An indication that something unexpected happened, or indicative of some problem in the near future.
- Error: Due to a more serious problem, the software has not been able to perform some function.
- Success: Indicates successful operations.
- Ratelimit: Warnings about rate limiting.
Performance Timing
You can log the duration of an operation by passing start
and end
times:
import time
from intensity_logger import Logger
logger = Logger()
start_time = time.time()
time.sleep(2)
end_time = time.time()
logger.success("Operation completed successfully.", start=start_time, end=end_time)
Contributing
Contributions are welcome! If you have ideas for improvements or new features, feel free to open an issue or submit a pull request on GitHub.
- Fork the repository.
- Create your feature branch.
- Commit your changes.
- Push to the branch.
- Open a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file intensity_logger-0.1.2.tar.gz
.
File metadata
- Download URL: intensity_logger-0.1.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5aa5672eb251859e9a1d25ca09556afbfa2fd77767ecb958303382c92cc2f32 |
|
MD5 | d8c20450a0e41dcd465f6f1a3a25b84b |
|
BLAKE2b-256 | 9db1f507c20c2670b81683543ea90bb7aefe1f9b4b90e3bc762da7bf59cc72eb |
File details
Details for the file intensity_logger-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: intensity_logger-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41191ff68e4841e9c8fdfd2faabf7e72a761c73d28586f2aac8003d6e9118491 |
|
MD5 | 88c8048b4f7917267a26ae10ecbfb976 |
|
BLAKE2b-256 | b918c8f7c3a1c97187816583fba16f363d45b9eabe76b5dafd506dd573e0175f |