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.
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| colorpaws-25.3.1.tar.gz | 4.4 kB | Without provenance | Details for colorpaws-25.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| colorpaws-25.3.1-py3-none-any.whl | Python 3 | none | any | Details for colorpaws-25.3.1-py3-none-any.whl |
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
|
Security for colorpaws 25.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.