Colorful logging library with log rotation and RGB support
Project description
FSLog - Simple Python Logging Library
This is my first Python logging library that helps you organize log messages with colorful output and log rotation.
Installation: pip install fsllog
How It Works?
Initialization: from fslog import FSLog
logger = FSLog( log_folder_path="/Logs", # Path to your log folder (default: "/Logs") max_logs=5 # Maximum number of log files to keep )
Basic Usage: logger.logging("Hello world!")
Output: [2023-11-15 14:30:00] [LOGGING] Hello world!
Custom Colors (RGB) logger.logging("Hello world!", (0, 255, 0)) # Green text
Log Levels:
Method Default Color Example .debug() Cyan logger.debug("Message") .info() Blue logger.info("Message") .logging() White logger.logging("Message") .server() White logger.server("Message") .warning() Yellow logger.warning("Message") .error() Red logger.error("Message") .custom() Custom See below
Custom Prefixes: logger.custom("Hello world!", "MY_PREFIX", (255, 0, 255)) # Purple text
Output: [2023-11-15 14:30:00] [MY_PREFIX] Hello world!
Log Rotation When the number of log files exceeds max_logs, the oldest files are automatically deleted.
Advanced Features
Enable debug mode to see internal calls
logger.lib_debug("on")
Get logging statistics
logger.logging_stats() # Shows: current log file, file count, size
Requirements Python 3.8+ No external dependencies
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fsllog-0.1.2.tar.gz.
File metadata
- Download URL: fsllog-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
584bef21a3834d0b401eac4dbbc2a4d2dea08245fecfa8d478358c9ca6a1375e
|
|
| MD5 |
d25ee1f64e6c79c217995b9adef2f5af
|
|
| BLAKE2b-256 |
84f04a9cffac3a9c4b130155004bfd8919065bbd612579a9d5522ba49be51a81
|
File details
Details for the file fsllog-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fsllog-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d30274774c580818ffe7e2a3f5a3a51b9d8eba7958aee90744110939a1a5908
|
|
| MD5 |
8a33659197ba5fbba9e354b2c908ed6c
|
|
| BLAKE2b-256 |
7d98ff5ed95838ed146a1662ece017a17867c6c8f1eba32c2dac95756df6e5a3
|