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)
```
Metadata
Release files for VersaLog 2.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| versalog-2.6.0.tar.gz | 9.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| versalog-2.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / versalog-2.6.0.tar.gz
| Download URL | versalog-2.6.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
840b59b2e5a36e3a5e4fc396769bcd74f6451e02ca31045d7637feec0632e81f
|
|
BLAKE2b-256 checksum How to use checksums |
13b2d15219a5f02fa1cc7a4a9ad1e0171bed35ab5c8aa69f031b1b19466eab4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|
Release files / versalog-2.6.0-py3-none-any.whl
| Download URL | versalog-2.6.0-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7f9c9306e30e27eee36b9920281e9856427ec7930fbff44ab7754eccc9eb956
|
|
BLAKE2b-256 checksum How to use checksums |
6939d86dd89fc556dd80df01235b45809fd5a7f3e7d736e6f64d65e7024ef307
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.10
|