Skip to main content

A library for terminal logging with color support and debug information

Project description

lite_logging

A lightweight Python library for terminal logging with color support and debug information.

Features

  • Colorful terminal output
  • Multiple log levels (INFO, DEBUG, WARNING, ERROR)
  • Debug mode with file and line number information
  • Simple and easy-to-use API

Installation

Install the package from PyPI:

pip install lite_logging

Usage

Basic Logging

from lite_logging.lite_logging import log

# Log levels: INFO (default), DEBUG, WARNING, ERROR
log("This is an info message")
log("This is a debug message", level="DEBUG")
log("This is a warning message", level="WARNING")
log("This is an error message", level="ERROR")

Debug Logging (with file and line information)

from lite_logging.lite_logging import log_debug

log_debug("This message includes file and line information")
log_debug("Debug error message", level="ERROR")

Configuration

You can configure logging behavior by modifying these variables:

from lite_logging.lite_logging import LOGGING_ENABLED, DEBUG_MODE, LOG_LEVEL

# Disable all logging
LOGGING_ENABLED = False

# Enable or disable debug messages
DEBUG_MODE = True

# Customize available log levels
LOG_LEVEL = ["INFO", "DEBUG", "WARNING", "ERROR", "CUSTOM"]

Available Colors

The LogColors class provides the following terminal colors:

  • HEADER (purple)
  • OKBLUE (blue)
  • OKCYAN (cyan)
  • OKGREEN (green)
  • WARNING (yellow)
  • FAIL (red)
  • OKYELLOW (yellow)
  • OKMAGENTA (magenta)
  • OKWHITE (white)
  • BOLD (bold text)
  • UNDERLINE (underlined text)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Missclick (gabrielgarronedev@gmail.com)

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

litelogging-1.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

litelogging-1.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file litelogging-1.0.1.tar.gz.

File metadata

  • Download URL: litelogging-1.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for litelogging-1.0.1.tar.gz
Algorithm Hash digest
SHA256 86cfab0a22aa8bb82ad01b80668fad4193c04c6402b14f98f5ccaacb943cc570
MD5 c808215f064e4ce4c2c6d836635558d0
BLAKE2b-256 a665a707e36c7ca48801767a833974ad5ae40980d3d940b23250f445d32bee45

See more details on using hashes here.

File details

Details for the file litelogging-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: litelogging-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for litelogging-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce33b01da56beb42fab0be26c1b58f1079994d7cd3a9b1858cb54ecab81a2aed
MD5 fba8033a0cfdbcff194c506aa76458f4
BLAKE2b-256 53cb57140ffce0ec96a2b1d36f6be43a43fddd757b63674cb5c1008408278a62

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