Skip to main content

Add your description here

Project description

logger4me

img1

A simple and colorful Python logging utility that provides enhanced console output with ANSI color codes and flexible file logging options.

Features

  • Colorful Console Output: Different log levels are displayed in different colors for better readability
  • File Logging Support: Optional file logging with customizable file paths
  • Color Control: Choose whether to save colors in log files or keep them plain text
  • Flexible Log Levels: Support for all standard Python logging levels (DEBUG, INFO, WARNING, ERROR, CRITICAL)
  • Easy Integration: Simple one-function setup for your logging needs

Installation

Install logger4me using uv:

uv add logger4me

Install logger4me using pip:

pip install logger4me

Usage

Basic Usage

from logger4me import get_logger

# Create a logger with default settings
logger = get_logger()

# Log messages at different levels
logger.debug("This is a debug message")
logger.info("This is an info message")
logger.warning("This is a warning message")
logger.error("This is an error message")
logger.critical("This is a critical message")

Advanced Configuration

from logger4me import get_logger
import logging

# Create a logger with custom settings
logger = get_logger(
    level = 10,        # Set minimum log level
    log_file = './logs/app.log',  # Save logs to file
    save_color = False            # Don't save ANSI colors to file
)

Parameters

  • level (int): Minimum logging level (default: logging.INFO)

    • 10: Debug messages and above(logging.DEBUG)
    • 20: Info messages and above(logging.INFO)
    • 30: Warning messages and above(logging.WARNING)
    • 40: Error messages and above(logging.ERROR)
    • 50: Critical messages only(logging.CRITICAL)
  • log_file (str, optional): Path to save log messages to a file (default: None)

    • If provided, creates the directory structure automatically
    • File is created in write mode, overwriting existing content
  • save_color (bool): Whether to save ANSI color codes in the log file (default: False)

    • True: Colors are preserved in the file
    • False: Plain text without color codes (recommended for file logs)

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

logger4me-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

logger4me-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file logger4me-0.1.1.tar.gz.

File metadata

  • Download URL: logger4me-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for logger4me-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1018444bbefd6a1dd9bdece519ed890c5ef6c1d4593502768f157ac0848e5c33
MD5 212edccea34da480fd309cf5904aac35
BLAKE2b-256 c79d351eb58ae18b65b9dc02e8f59a52abedc7f5b053ec1a4e3e442946b99adc

See more details on using hashes here.

File details

Details for the file logger4me-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: logger4me-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for logger4me-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0ed10e635d45148219f5c637132b793129be4a563c04564007ac6ef546253b4
MD5 d70e37db2e68e2c8af2b38c266def89a
BLAKE2b-256 ca06ede4d1ec790f0d1a2db416795e3613910af4e21fd927c5e3865f9e7533e5

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