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.8+
  • 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.3.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.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysmartlogger-1.2.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ba63d4ecf686d6ec6a4bbdb625ce4af6e0a59025a3bbd1e460ae24c360bd3fdb
MD5 447acd7599629b08835f76a49a70e7e3
BLAKE2b-256 ef42f887d892eb6d87a8b410c043fd2911180f9b8a9a2b64758f86db188b5042

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysmartlogger-1.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7482414baeb62c5a8ed07d42634637ae82b96a2cc1087259e9ca4ef47b1e3860
MD5 5f179caab0b5e0ac120b2dfae878d3ae
BLAKE2b-256 c0f7db3a4459e410229bbc39544fb57fcd3a3934fa2b0bb5ba67b291808189ce

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