An advanced yet easy-to-use logging library.
Project description
Concise Logging
An advanced yet easy-to-use logging library.
Features
- Colorful Logging: Different colors for TRACE, DEBUG, INFO, WARN, ERROR, and FATAL messages.
- Custom Time Format: Pick 12-hour or 24-hour time, with optional Unix time.
- Extra Tags: Add custom tags to make log messages clearer.
- Multiple Methods: Log using TRACE, DEBUG, INFO, WARN, ERROR, and FATAL.
Installation
pip install concise-logging
Usage Example
from ConciseLogging import ConciseLogger
logger = ConciseLogger(time_format=24, unix=True)
logger.trace("SYSTEM", "INIT", message="This is a trace message.")
logger.debug("DATABASE", message="Debugging database connection.")
logger.info("SERVER", message="Server started successfully.")
logger.warn("MEMORY", message="Memory usage is high!")
logger.error("API", "TIMEOUT", message="Failed to fetch data from API.")
logger.fatal("CRASH", message="Application crashed unexpectedly.")
Log Output Example
[25/02/2025 14:35:22 1677332122] [TRACE] [SYSTEM] [INIT] This is a trace message.
[25/02/2025 14:35:23 1677332123] [DEBUG] [DATABASE] Debugging database connection.
[25/02/2025 14:35:24 1677332124] [INFO] [SERVER] Server started successfully.
[25/02/2025 14:35:25 1677332125] [WARN] [MEMORY] Memory usage is high!
[25/02/2025 14:35:26 1677332126] [ERROR] [API] [TIMEOUT] Failed to fetch data from API.
[25/02/2025 14:35:27 1677332127] [FATAL] [CRASH] Application crashed unexpectedly.
Configuration Options
| Parameter | Description | Default |
|---|---|---|
time_format |
Time display format (12 or 24 hours) |
24 |
unix |
Append Unix timestamp (True or False) |
False |
License
This project is licensed under the MIT License.
Author
Made with ♥ by Ayaan
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 concise_logging-1.0.2-py3-none-any.whl.
File metadata
- Download URL: concise_logging-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68278f4a576163b6abbd8192858bc3697a62ada8208ab75d58ed2ea0488d1e1a
|
|
| MD5 |
63cdaa55f5bc9fea5562b39dfafae255
|
|
| BLAKE2b-256 |
cea3fc9e9d85f8abf0cf9baeabdd8aef3e81588c424e02fa1e3d7f73452b9ce5
|