Skip to main content

Debug and logging utility with colored output and timers.

Project description

pydelog

pydelog is a lightweight, colorful, and simple debug/logging utility for Python.
It provides:

  • Colored logs
  • Multiple log levels
  • A built-in timer decorator
  • Easy and clean integration

Installation

pip install pydelog

Basic Usage

from pydelog import DebugUtils

DebugUtils.log_i("Information message")
DebugUtils.log_e("Error occurred!")
DebugUtils.log_w("This is a warning")
DebugUtils.log_d("Debug message")

Timer Example

from pydelog import DebugUtils

@DebugUtils.timer
def sample_task():
    for _ in range(1000000):
        pass

sample_task()

Output:

[DEBUG] sample_task executed in 0.123456s

Disable Colors or Logs

Disable colored output:

from pydelog import DebugUtils
DebugUtils.ENABLE_COLOR = False

Disable all logs:

DebugUtils.ENABLE_LOGS = False

Available Log Levels

from pydelog import DebugUtils, LogLevel

DebugUtils.log_i("Info")
DebugUtils.log_e("Error")
DebugUtils.log_d("Debug")
DebugUtils.log_f("Fatal")
DebugUtils.log_c("Critical")
DebugUtils.log_w("Warning")
DebugUtils.log_t("Trace")
DebugUtils.log_v("Verbose")
DebugUtils.log_s("System")
DebugUtils.log_a("Alert")

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

pydelog-1.0.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

pydelog-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pydelog-1.0.0.tar.gz.

File metadata

  • Download URL: pydelog-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pydelog-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ea401925d82ac30413a18391995225cc742999c7232bab0a7f54dd62adf77561
MD5 f3cae13185ec16c63074a6aba7293e07
BLAKE2b-256 d8c71a4e9bd640b918962ece4f40a0ed3e266a32f2ceb4f661c52276d9ab2ea2

See more details on using hashes here.

File details

Details for the file pydelog-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pydelog-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pydelog-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 384bdb1274614267c1e1d73892d122ead171b48d7c493b6f17ee505395e7cb2a
MD5 24070135cedbfc2d135a838572852f2f
BLAKE2b-256 ca1958090cf8a2ea3e65e4a0b21bd5b4f2435cb6cc67c6e1281558b660504144

See more details on using hashes here.

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