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.1.0.tar.gz (4.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.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: litelogging-1.1.0.tar.gz
  • Upload date:
  • Size: 4.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.1.0.tar.gz
Algorithm Hash digest
SHA256 f42b5f1e47b1aeb075c3f58af61f1bc12f03cba885f7de1f80747be9724a3405
MD5 e169bd5951bafca1395ee39d994eb40c
BLAKE2b-256 3ce29c13d6dbba16ae6250890e0b7f85ee972ab92a017b1bb479b93cd7d7fb10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: litelogging-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa8d36b77050a050b2fcddaadaa5ca994f066807858e0caf593949c61ea8310c
MD5 2b1d799513154dd9c57b157590ae034e
BLAKE2b-256 e2a0c5dbf82c5bb516f7841828296b3d553b14c172e5b3f4faeaf11a7336c60d

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