Skip to main content

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_blue
  • bright_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

madebydouxx adpipproject

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

dlogger-1.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dlogger-1.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

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

Hashes for dlogger-1.0.tar.gz
Algorithm Hash digest
SHA256 5263332c04449da596f7631ba5cc84e175cdb8c2605dbbeda28044dbae7839ab
MD5 6b0ab28b2701d32d7ee48f7477827759
BLAKE2b-256 455e60fbdff954241278e295017fc9d5d88f9f217f63a28c5b6fda67ed7c81b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dlogger-1.0.tar.gz:

Publisher: python-publish.yml on dpipstudio/dlogger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for dlogger-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1125e7849ea4cbe3c606ea762562f2599bc4e46c6dbdb70e15d86e06f95555f7
MD5 f4e64cfa83a9973ca4fdaae76121694d
BLAKE2b-256 fe9107e60ea3860e5ee3aa39e787453b0af047237697fbff8229409233060336

See more details on using hashes here.

Provenance

The following attestation bundles were made for dlogger-1.0-py3-none-any.whl:

Publisher: python-publish.yml on dpipstudio/dlogger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page