Versatile logging library.
Project description
What is VersaLog.py?
What is VersaLog.py?
VersaLog is a modern, powerful, and flexible logging library for Python. It supports everything from simple usage to advanced, highly customizable configurations, making it suitable for a wide range of use cases.
Feature
Basic Logging
- Supports standard log levels:
INFO,ERROR,WARNING,DEBUG,CRITICAL
- Colored output for better readability
- Symbol-based prefixes (e.g.
[+],[-],[!])
Multiple Output Formats
Easily switch between different log styles:
simple→[+] messagesimple2→[TIME] [+] messagedetailed→[TIME][LEVEL] : messagefile→[FILE:LINE][LEVEL] message
Tag System
- Add custom tags to logs
- Supports multiple tags (e.g.
["API", "AUTH"]) - Optional default tags
File & Line Tracking
- Display caller file name and line number
- Useful for debugging large projects
Log File Saving
- Automatically save logs to files
- Output path:
./log/YYYY-MM-DD.log - Select which log levels to save
Auto Cleanup
- Automatically deletes old log files (default: 7 days)
- Keeps your log directory clean
Auto Cleanup
- Disable console output
- Useful for background services
Exception Handling
- Automatically captures unhandled exceptions
- Logs them as
CRITICAL
Desktop Notifications
- Optional desktop alerts for errors and critical logs
- Uses
plyer.notification
Asynchronous Logging
- Non-blocking log processing using threads and queues
- Improves performance in high-load environments
Support
Join our Discord server for support, questions, and community discussions:
Installation
pip install VersaLog
Enum
| Enum | Description |
|---|---|
detailed |
Logs including execution time and log levels |
file |
Logs with filename and line number |
simple |
Simple and easy-to-read logs |
simple2 |
Simple and easy-to-read log format. The timestamp is automatically included. |
Options
| Options | Description |
|---|---|
show_file |
True : Display filename and line number (for simple and detailed modes) |
show_tag |
True : Show self.tag if no explicit tag is provided |
tag |
Default tag to use when show_tag is enabled |
enable_all |
Shortcut to enable both show_file and show_tag |
notice |
True : When an error or critical level log is output, a desktop notification (using plyer.notification) will be displayed. The notification includes the log level and message. |
all_save |
True : When an error or critical level log is output, the log will be saved to a file. |
save_levels |
A list of log levels to save. Defaults to ["INFO", "ERROR", "WARNING", "DEBUG", "CRITICAL"]. |
silent |
True : Suppress standard output (print) |
catch_exceptions |
True : Automatically catch unhandled exceptions and log them as critical |
Tag set
# one tag
logger = VersaLog(enum="detailed", tag="a", show_tag=True)
# two tag
logger = VersaLog(enum="detailed", tag=["a", "a"], show_tag=True)
```
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 versalog-2.6.0.tar.gz.
File metadata
- Download URL: versalog-2.6.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
840b59b2e5a36e3a5e4fc396769bcd74f6451e02ca31045d7637feec0632e81f
|
|
| MD5 |
a6a04806e2b73ca703f544d81a2c7a55
|
|
| BLAKE2b-256 |
13b2d15219a5f02fa1cc7a4a9ad1e0171bed35ab5c8aa69f031b1b19466eab4c
|
File details
Details for the file versalog-2.6.0-py3-none-any.whl.
File metadata
- Download URL: versalog-2.6.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7f9c9306e30e27eee36b9920281e9856427ec7930fbff44ab7754eccc9eb956
|
|
| MD5 |
8b8da022ab3390da1a18f1b047c01c91
|
|
| BLAKE2b-256 |
6939d86dd89fc556dd80df01235b45809fd5a7f3e7d736e6f64d65e7024ef307
|