Dynamic Console Logger for Python with colored output, custom icons, and other features.
Project description
DLogger
A lightweight, dynamic console logger for Python with colored output and automatic method generation.
Installation
pip install dlogger
Or just copy dlogger.py into your project.
Quick Start
from dlogger import DLogger
# Create your logger with custom icons and colors
Log = DLogger(
icons={
'success': 'OK',
'error': 'ERR',
'warning': 'WARN',
'info': 'INFO',
},
styles={
'success': 'bright_green',
'error': 'bright_red',
'warning': 'bright_yellow',
'info': 'bright_cyan',
}
)
# Use the dynamically generated methods
Log.success("Operation completed!")
Log.error("Something went wrong!")
Log.warning("Be careful!")
Log.info("Just so you know...")
Output:
[OK] Operation completed! # in bright green
[ERR] Something went wrong! # in bright red
[WARN] Be careful! # in bright yellow
[INFO] Just so you know... # in bright cyan
Available Colors
DLogger supports the following color styles:
Standard Colors
red,green,yellow,blue,magenta,cyan,white
Bright Colors
bright_red,bright_green,bright_yellow,bright_bluebright_magenta,bright_cyan,bright_white
Text Styles
bold,underline,reset
Additional Features
Headers and Sections
Log.header("My Application")
Log.section("Configuration")
Progress Bars
for i in range(101):
Log.progress_bar(i, 100, prefix='Loading:', suffix='Complete')
Manual Printing
# Print without using generated methods
Log.print("Custom message", style='magenta', icon='CUSTOM')
How It Works
DLogger automatically generates methods based on your icons dictionary. Each key becomes a method name:
Log = DLogger(
icons={'database': 'DB', 'api': 'API', 'cache': 'CACHE'},
styles={'database': 'green', 'api': 'blue', 'cache': 'yellow'}
)
Log.database("Connected to PostgreSQL") # [DB] Connected to PostgreSQL
Log.api("Request received") # [API] Request received
Log.cache("Cache hit!") # [CACHE] Cache hit!
License
Licensed under GPLv3.0, see LICENSE
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 dlogger-1.0.tar.gz.
File metadata
- Download URL: dlogger-1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5263332c04449da596f7631ba5cc84e175cdb8c2605dbbeda28044dbae7839ab
|
|
| MD5 |
6b0ab28b2701d32d7ee48f7477827759
|
|
| BLAKE2b-256 |
455e60fbdff954241278e295017fc9d5d88f9f217f63a28c5b6fda67ed7c81b2
|
Provenance
The following attestation bundles were made for dlogger-1.0.tar.gz:
Publisher:
python-publish.yml on dpipstudio/dlogger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dlogger-1.0.tar.gz -
Subject digest:
5263332c04449da596f7631ba5cc84e175cdb8c2605dbbeda28044dbae7839ab - Sigstore transparency entry: 702407184
- Sigstore integration time:
-
Permalink:
dpipstudio/dlogger@45c61bc56dc9c1df98049cf59818e740ccfb419b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dpipstudio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@45c61bc56dc9c1df98049cf59818e740ccfb419b -
Trigger Event:
push
-
Statement type:
File details
Details for the file dlogger-1.0-py3-none-any.whl.
File metadata
- Download URL: dlogger-1.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1125e7849ea4cbe3c606ea762562f2599bc4e46c6dbdb70e15d86e06f95555f7
|
|
| MD5 |
f4e64cfa83a9973ca4fdaae76121694d
|
|
| BLAKE2b-256 |
fe9107e60ea3860e5ee3aa39e787453b0af047237697fbff8229409233060336
|
Provenance
The following attestation bundles were made for dlogger-1.0-py3-none-any.whl:
Publisher:
python-publish.yml on dpipstudio/dlogger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dlogger-1.0-py3-none-any.whl -
Subject digest:
1125e7849ea4cbe3c606ea762562f2599bc4e46c6dbdb70e15d86e06f95555f7 - Sigstore transparency entry: 702407185
- Sigstore integration time:
-
Permalink:
dpipstudio/dlogger@45c61bc56dc9c1df98049cf59818e740ccfb419b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dpipstudio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@45c61bc56dc9c1df98049cf59818e740ccfb419b -
Trigger Event:
push
-
Statement type: