Skip to main content

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 as 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 timestamps
  • color — enable or disable colors
  • simple — disable prefixes
  • file_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

dlf4p-1.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

dlf4p-1.1.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file dlf4p-1.1.1.tar.gz.

File metadata

  • Download URL: dlf4p-1.1.1.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

Hashes for dlf4p-1.1.1.tar.gz
Algorithm Hash digest
SHA256 9e9070bdfd82d16632622520d2ea232769e11c1fdd3fbb01c33b9bc3a0f79488
MD5 e0c3e3b5a23777c315ff41594fc83b2e
BLAKE2b-256 b630054a34048878757c92dcedc88bdd0ad18ce42ffb2a3302044378c035b376

See more details on using hashes here.

File details

Details for the file dlf4p-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: dlf4p-1.1.1-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

Hashes for dlf4p-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f512a4ee93a56d44527c71687f9da3af34cf70ac65ad637467842ba0be418cab
MD5 556820ece6a55ee66051291c5e44a0db
BLAKE2b-256 bbcbf194e17fa55b60e986dae25e5c16e01e9a00a24ef71c8b8f21ea46bdcf15

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