Skip to main content

colorpaws

A powerful, flexible logging component that enhances Python's built-in logging with colored output and automated file organization.

Installation

pip install colorpaws

Key Features

  • 🎨 Console Output
    • Colored logging with level-based colors
    • Cross-platform support (Windows/Unix)
    • Smart color detection and handling
  • 📁 File Management
    • Automatic date-based organization
    • Timestamp-based unique files
    • No duplicate handlers
  • ⚙️ Configuration
    • Dual output (console and/or file)
    • Customizable log formats
    • Singleton loggers per name

Usage

Basic Console Logging

from colorpaws import ColorPaws

# Initialize (console only)
logger = ColorPaws(
    name="MyApp",        # Logger instance name
    log_on=True,         # Enable/disable logging
    log_to=None          # No file output
)

# Log messages
logger.debug("Debug information")     # Blue - Detailed debugging
logger.info("Operation complete")     # Green - General information
logger.warning("Low memory")          # Yellow - Potential issues
logger.error("Process failed")        # Red - Serious problems
logger.critical("System crash")       # Magenta - Critical failures

File and Console Logging

# Initialize (console + file)
logger = ColorPaws(
    name="MyApp",        # Logger instance name
    log_on=True,         # Enable/disable logging
    log_to="logs"        # Log directory path
)

# Example with exception handling
try:
    # Your code here
    logger.info("Processing started")
    logger.debug("Loading config...")
    raise ValueError("Invalid input")

except Exception as e:
    logger.error(
        "Process failed",
        exc_info=True    # Include stack trace
    )

Log File Structure

logs/
└── YYYY-MM-DD/
    ├── YYYYMMDD_HHMMSS_MyApp.log
    ├── YYYYMMDD_HHMMSS_MyApp.log
    └── ...

Configuration

Parameters

Parameter Type Default Description
name str Required Logger name
log_on bool False Enable logging
log_to str None Log directory

Log Colors

Level Color Usage
DEBUG Blue Detailed debugging
INFO Green General messages
WARNING Yellow Potential issues
ERROR Red Serious problems
CRITICAL Magenta Critical failures

Log Format

Default: YYYY-MM-DD HH:MM:SS - LEVEL - Message

Best Practices

# Hierarchical naming
logger = ColorPaws("MyApp.SubModule")

# Proper level usage
logger.debug("Detailed debug info")    # Development
logger.info("Operation status")        # General
logger.warning("Potential issue")      # Caution
logger.error("Operation failed")       # Problems
logger.critical("System failure")      # Emergencies

# Exception handling
try:
    # Your code
except Exception as e:
    logger.error("Failed", exc_info=True)

License

See LICENSE for details.

Release files for colorpaws 25.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colorpaws 25.3.1
File Size Uploaded
colorpaws-25.3.1.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colorpaws 25.3.1
File Interpreter ABI Platform
colorpaws-25.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / colorpaws-25.3.1.tar.gz

Download URL colorpaws-25.3.1.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
78bf342176a0cc6f68cd7accc7dbddd534ea9a176425c6e18d43939cc877f4e4
BLAKE2b-256 checksum
How to use checksums
9ceadbf47187e284d301733b45461e2a378ecc6925c9f323ada188317de0903e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release files / colorpaws-25.3.1-py3-none-any.whl

Download URL colorpaws-25.3.1-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bacada6b1f914092a5fb031dd4cb4579a74faba1dd993c3f8fc46236f8c30694
BLAKE2b-256 checksum
How to use checksums
48c53865d81f6fd414eb030ed217475ba70d98c85da959d54e0b42477a9d8299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release history Release notifications | RSS feed

This release

25.3.1 This release

2 release files

25.3

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page