DetayLog
A minimalist, colorful, and zero-dependency logging library for Python.
Key Features
- Colorized Console Output: Distinct ANSI colors for each log level (INFO, SUCCESS, WARNING, ERROR, CRITICAL).
- Automatic File Logging: Saves logs to a specified file with precise timestamps.
- Location Tracking: Automatically identifies and logs the source filename and line number (
[file.py:line]). - Zero External Dependencies: Built entirely with pure Python standard library modules (
datetime,os,inspect,traceback). - Exception Handling: Log complete stack traces effortlessly using
log.exception().
Installation
Install the package directly via pip:
pip install detaylog
Quick Start & Usage
from detaylog import DetayLog
Initialize the logger
log = DetayLog(log_file="app.log", show_location=True)
Log messages with different severity levels
log.info("System starting up...") log.success("Database connection established!") log.warning("User entered incorrect password.") log.error("Server unresponsive.") log.critical("System memory critically high at 99%!")
Automatic Exception Logging (Traceback)
try: result = 10 / 0 except Exception: log.exception("An unexpected math error occurred!")
Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
log_file |
str |
"app.log" |
Target path for saving log output files. |
write_to_file |
bool |
True |
Toggle writing log outputs to a file. |
show_location |
bool |
True |
Toggle displaying [filename:line] location data. |
License
Distributed under the Apache License 2.0. See the LICENSE file for details.
Release files for detaylog 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| detaylog-1.0.2.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| detaylog-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.6 kB
Release files / detaylog-1.0.2.tar.gz
| Download URL | detaylog-1.0.2.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6680c7850fdfa52eb1cad37b096062baa1691bcef0560f231de0794110366ac
|
|
BLAKE2b-256 checksum How to use checksums |
b29a8e62bc0058a79c52ab2f9e8ff5e9642cb0b97dee77b619aef631235b41ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / detaylog-1.0.2-py3-none-any.whl
| Download URL | detaylog-1.0.2-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4bbee058799b24479911d3a4a3a7addaa8a1638f7e0be3a2a55d632cd5fd2a9d
|
|
BLAKE2b-256 checksum How to use checksums |
c3c2ddb99f01d4ffad0caca4f6b6b293321f0be6116df2d552a9d3a5f74bb318
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|