A colorful logging utility for Python applications
Project description
ColorLogger
A simple and flexible logging module with color-coded output for enhanced readability.
Table of Contents
Introduction
ColorLogger is a Python logging module designed to provide simple, color-coded logging output. It helps to easily distinguish different log levels, such as success, info, failure, and rate limit warnings.
Features
- Color-coded log messages for easy readability.
- Support for different log levels: success, info, failure, and ratelimit.
- Optional performance timing display for operations.
- Lightweight and easy to integrate into any Python project.
Installation
You can install ColorLogger via pip:
pip install intensity-logger
Usage
Basic Usage Here's a basic example to get you started with ColorLogger:
from intensity_logger import Logger
logger = Logger()
logger.success("Operation completed successfully.")
logger.info("This is an informational message.")
logger.failure("An error occurred.")
logger.ratelimit("Rate limit reached.")
Log Levels
ColorLogger supports various log levels, each with a different color:
-> Success: Indicates successful operations. -> Info: Provides informational messages. -> Failure: Logs errors and failures. -> 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
Hashes for intensity_logger-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c604d279a6bb0308a177c21f6c1baae983eee7a353cd72cd37136b75170bcaca |
|
MD5 | 02230573325ab5ec82d9f116e0396634 |
|
BLAKE2b-256 | 76e25ef724eeca003ef975f1cdc94ad396b143ff0bb71812c8ecf1063aadef50 |