Dexoron Logging Framework for Python
Project description
dlf4p — Dexoron Logging Framework for Python
dlf4p is a lightweight and convenient logger for Python inspired by SLF4J.
It provides a simple API for logging messages with support for log levels, colored console output, timestamps, and file logging.
The project is being developed as part of the DLF (Dexoron Logging Framework) family, with plans for implementations in other programming languages.
Features
- Log levels:
DEBUG,INFO,SUCCESS,WARNING,ERROR,FATAL - Colored console output
- Timestamp support
- Prefix support (e.g., module or component name)
- File logging
- Simple configuration via
setup() - Lightweight and with no external dependencies
Installation
Install from PyPI:
pip install dlf4p
Quick Start
import dlf4p an dlf
dlf.setup(time=True, color=True, simple=False, file_logging=True)
dlf.info("Application started", "Main")
dlf.success("Server successfully started", "Server")
dlf.warning("Slow response", "API")
dlf.error("Database connection error", "Database")
dlf.fatal("Critical error", "System")
Example console output:
[12:30:10] [Main/INFO]: Application started
[12:30:11] [Server/SUCCESS]: Server successfully started
[12:30:12] [API/WARNING]: Slow response
[12:30:13] [Database/ERROR]: Database connection error
[12:30:14] [System/FATAL]: Critical error
Logs are saved to a file without ANSI color codes.
Configuration
The setup() function is used to configure the logger:
dlf.setup(
time=True, # show timestamp
color=True, # enable colored output
simple=False, # simplified log format (without prefixes)
file_logging=True # enable file logging
)
Parameters:
time— enable or disable timestampscolor— enable or disable colorssimple— disable prefixesfile_logging— enable writing logs to a file
Philosophy
dlf4p is inspired by SLF4J (Simple Logging Facade for Java) and aims to:
- provide a simple and unified logging interface
- remain minimalistic
- have no external dependencies
- be easily extensible to other programming languages
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Dexoron
GitLab: https://gitlab.com/dexoron GitHub: https://github.com/dexoron Website: https://dexoron.su
dlf4p — a simple logger today, a full logging framework tomorrow.
Project details
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 dlf4p-1.1.0.tar.gz.
File metadata
- Download URL: dlf4p-1.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b10a94802067d9eb72c14261e906103d0e127a2aee012ba4f2758fe8e5480597
|
|
| MD5 |
4756945a24ef5da5a07b4e8ca8a33b18
|
|
| BLAKE2b-256 |
0c76f277fc896803f7e093994760e97f0f4be44bf846c80dbd7e80ad815c75b2
|
File details
Details for the file dlf4p-1.1.0-py3-none-any.whl.
File metadata
- Download URL: dlf4p-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
880c7e15b816c534c711fefa3f828fc97a538296e9440e6b0bed03fe16922034
|
|
| MD5 |
e5b82dd1774519ce8b51494eea9809d0
|
|
| BLAKE2b-256 |
626d86d54fcf35a6cca0b13e6b4bbd1314b2f8178e3909e7b15f9f123dd9f254
|