Skip to main content

A cross-platform Python library that adds colorful logging capabilities to the standard logging module

Project description

SmartLogger

A cross-platform Python library that adds beautiful, colorful logging capabilities to the standard Python logging module with zero configuration required.

Features

  • 🎨 Colorful Logs: Each log level gets its distinctive color
  • 🔧 Zero Configuration: Just import and it works automatically
  • 🖥️ Cross-Platform: Works on Windows, macOS, and Linux
  • 🏃 Performance Optimized: Minimal overhead on your application
  • 🛡️ Safe: Won't break existing logging functionality
  • 📱 Smart Detection: Automatically detects terminal capabilities

Installation

pip install pysmartlogger

Usage

Simply import smartlogger.auto and your existing logging will become colorful:

import logging
import smartlogger.auto

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

logger.debug("This is a debug message")     # Blue
logger.info("This is an info message")      # Green  
logger.warning("This is a warning message") # Yellow
logger.error("This is an error message")    # Red
logger.critical("This is a critical message") # Bright Red

Color Scheme

Level Color Description
DEBUG Blue Development and debugging information
INFO Green General information messages
WARNING Yellow Warning messages for potential issues
ERROR Red Error messages for failures
CRITICAL Bright Red Critical errors requiring immediate attention

Compatibility

  • Python: 3.7+
  • Operating Systems: Windows, macOS, Linux
  • Terminals: CMD, PowerShell, bash, zsh, fish
  • IDEs: VS Code, PyCharm, Jupyter, and more

How It Works

SmartLogger uses monkey-patching to enhance the standard logging module. When you import smartlogger.auto, it automatically:

  1. Detects if your environment supports colors
  2. Patches the logging formatters to add color codes
  3. Maintains full compatibility with existing logging configuration

License

MIT License - see LICENSE file for details.

Author

Mohammad Rasol Esfandiari

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

pysmartlogger-1.2.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

pysmartlogger-1.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file pysmartlogger-1.2.0.tar.gz.

File metadata

  • Download URL: pysmartlogger-1.2.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for pysmartlogger-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e5f2956d2580e132b2bfead62c62471b5d50a7be1a60be7a2b93f16105623044
MD5 215037722e10b73ae0ce810a6b3f206f
BLAKE2b-256 51b99ef5bcace2e34ad5d878a107ad756310255a0793edf25340ec34904ae856

See more details on using hashes here.

File details

Details for the file pysmartlogger-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pysmartlogger-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for pysmartlogger-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73f0b962d779259dbca25e35f9a83635542894c5ef5bcf2cec4c0eca562b0fc2
MD5 533de9bb36366d7b002c6b7c14f1c961
BLAKE2b-256 c11917a15a64784b41e6b26a85ec8e148ce9d19b803b031f08fcb2e39ff714f0

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