A minimalist, colorful, and zero-dependency logging library for Python.
Project description
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.
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 detaylog-1.0.2.tar.gz.
File metadata
- Download URL: detaylog-1.0.2.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6680c7850fdfa52eb1cad37b096062baa1691bcef0560f231de0794110366ac
|
|
| MD5 |
af82cd52aff8e17a3cf70d4508369a69
|
|
| BLAKE2b-256 |
b29a8e62bc0058a79c52ab2f9e8ff5e9642cb0b97dee77b619aef631235b41ca
|
File details
Details for the file detaylog-1.0.2-py3-none-any.whl.
File metadata
- Download URL: detaylog-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bbee058799b24479911d3a4a3a7addaa8a1638f7e0be3a2a55d632cd5fd2a9d
|
|
| MD5 |
c9b10ce7573b4b769a1c4245f2f37b1f
|
|
| BLAKE2b-256 |
c3c2ddb99f01d4ffad0caca4f6b6b293321f0be6116df2d552a9d3a5f74bb318
|