High-performance colored, multi-process logging library for Python
Project description
prismalog
A robust, multi-process safe logging system for Python applications that integrates perfectly with the psy-supabase package.
Features
- ⚛️ Zero-dependency core
- 🚀 High performance
- 🎨 Colored console output
- 📁 Automatic log file rotation
- 🔄 Multi-process safe logging
- 🧵 Multithreading-safe logging
- ⚙️ YAML-based configuration
- 🔇 Control for verbose third-party libraries
- 🧪 Testing support
Performance Characteristics
prismalog was designed for high-performance applications. My testing shows:
- Overhead per log call: ~0.15ms (typical)
- Memory impact: Minimal (~0.3MB for 10,000 messages)
- Throughput: Capable of handling 20,000+ messages per second
- Multi-process/Multi-threading safety: No measurable performance penalty compared to single-process
Performance Notes
While prismalog achieves excellent performance characteristics, it's important to note that the primary bottleneck is filesystem I/O when writing to log files. This limitation is inherent to disk-based logging systems:
- File locking mechanisms required for multi-process safety introduce some overhead
- Synchronous writes to ensure log integrity can impact throughput during high-volume logging events
- Storage device speed directly impacts maximum sustainable throughput
For applications with extreme logging requirements, consider:
- Using an asynchronous logging configuration
- Implementing log batching for high-volume events
- Configuring separate log files for different components to distribute I/O load
The current performance metrics were achieved with standard SSD hardware. With specialized I/O optimization or enterprise-grade storage systems, significantly higher throughput is achievable.
Quick Start
from prismalog import get_logger, LoggingConfig
# Initialize with configuration file
LoggingConfig.initialize(config_file="config.yaml")
# Get a logger
logger = get_logger("my_module")
logger.info("Application started")
Command-Line Integration
Any application using prismalog automatically supports these command-line arguments:
--log-config PATH # Path to logging configuration file
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
# Set the default logging level
--log-dir PATH # Directory where log files will be stored
Usage
from prismalog.log import get_logger, LoggingConfig
# Initialize logging (with command-line support)
LoggingConfig.initialize(use_cli_args=True)
# Get logger and use it
logger = get_logger("my_app")
logger.info("Application started")
Dependencies
prismalog is designed to work with zero external dependencies for core functionality. It relies solely on the Python standard library, making it lightweight and easy to integrate into any project.
Optional Dependencies
- YAML Configuration: If YAML config files needed, install with
pip install prismalog[yaml] - Development: For running tests and examples, install with
pip install prismalog[dev]
Installation Options
# Prepare before installation (recommended)
python -m venv .venv
source source .venv/bin/activate
# Basic installation - no external dependencies
pip install -e .
# With documentation support
pip install prismalog[doc]
# For development and testing
pip install prismalog[dev]
# With all optional features
pip install prismalog[all]
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prismalog-0.1.3.tar.gz.
File metadata
- Download URL: prismalog-0.1.3.tar.gz
- Upload date:
- Size: 56.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f73d16d2649baab6533c75872f683e5e536c8fbf452adf2edd300cf4cea821fd
|
|
| MD5 |
a29ca864cbb05c0d23ad64ee7b6f2ba1
|
|
| BLAKE2b-256 |
8f5d32a8f05d2c0629a20ff5e1d63263bbf586fff0a28ea7ff9bd1d19044095f
|
Provenance
The following attestation bundles were made for prismalog-0.1.3.tar.gz:
Publisher:
prismalog_ci.yml on vertok/prismalog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prismalog-0.1.3.tar.gz -
Subject digest:
f73d16d2649baab6533c75872f683e5e536c8fbf452adf2edd300cf4cea821fd - Sigstore transparency entry: 223003621
- Sigstore integration time:
-
Permalink:
vertok/prismalog@248f013024ee75db691cedbad8c3b9882a8837d7 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/vertok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
prismalog_ci.yml@248f013024ee75db691cedbad8c3b9882a8837d7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file prismalog-0.1.3-py3-none-any.whl.
File metadata
- Download URL: prismalog-0.1.3-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34dbdc84a099f3c024a310f04a0a11f6d9a28472c5c84c2fec5322a498fe9f61
|
|
| MD5 |
51603f303c4eb1f3beac5401b30098da
|
|
| BLAKE2b-256 |
b099cafd176d7257cede1c46d1d639ca9e1550c6211f8b0a097143332ea22901
|
Provenance
The following attestation bundles were made for prismalog-0.1.3-py3-none-any.whl:
Publisher:
prismalog_ci.yml on vertok/prismalog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prismalog-0.1.3-py3-none-any.whl -
Subject digest:
34dbdc84a099f3c024a310f04a0a11f6d9a28472c5c84c2fec5322a498fe9f61 - Sigstore transparency entry: 223003623
- Sigstore integration time:
-
Permalink:
vertok/prismalog@248f013024ee75db691cedbad8c3b9882a8837d7 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/vertok
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
prismalog_ci.yml@248f013024ee75db691cedbad8c3b9882a8837d7 -
Trigger Event:
push
-
Statement type: