A previous release had provenance metadata, but this release does not. View details.
This project has been archived by its maintainers, and is no longer receiving any updates.
LifecycleLogging
A comprehensive logging utility for managing application lifecycle logs, combining the power of Python's logging with rich output formatting.
Installation
pip install lifecyclelogging
Features
- Configurable console and file logging outputs
- Rich formatting for enhanced readability
- Message storage with context and storage markers
- Verbosity controls with bypass markers
- Case-insensitive level filtering for allowed/denied storage rules
- JSON data attachment support
- Type-safe implementation
- Seamless integration with existing logging systems
- Automatic Gunicorn logger integration
Project Goals
- Provide a batteries-included logging helper that stays compatible with modern Python releases
- Keep configuration ergonomic while remaining type-safe and explicit
- Offer sensible defaults that work locally and in containerized runtimes
- Deliver reliable automation through testing, linting, and release workflows
Basic Usage
from lifecyclelogging import Logging
# Initialize logger
logger = Logging(
enable_console=True, # Enable console output
enable_file=True, # Enable file output
logger_name="my_app"
)
# Basic logging
logger.logged_statement("Basic message", log_level="info")
# With context marker
logger.logged_statement(
"Message with context",
context_marker="STARTUP",
log_level="info"
)
# With JSON data
logger.logged_statement(
"Message with data",
json_data={"key": "value"},
log_level="debug"
)
Advanced Features
Verbosity Control
logger = Logging(
enable_verbose_output=True,
verbosity_threshold=2
)
# Only logged if verbosity threshold allows
logger.logged_statement(
"Detailed debug info",
verbose=True,
verbosity=2,
log_level="debug"
)
Verbosity Bypass Helpers
logger.register_verbosity_bypass_marker("IMPORTANT")
# Will be logged regardless of verbosity settings
logger.logged_statement(
"Critical info",
context_marker="IMPORTANT",
verbose=True,
verbosity=5,
log_level="debug"
)
Message Storage
# Store message under a marker
logger.logged_statement(
"Important event",
storage_marker="EVENTS",
log_level="info"
)
# Access stored messages
events = logger.stored_messages["EVENTS"]
Gunicorn Integration
When running under Gunicorn, LifecycleLogging automatically detects and inherits Gunicorn's logger configuration:
# The logger will automatically use Gunicorn's handlers if available
logger = Logging(
enable_console=True,
enable_file=True
)
Development
# Install development dependencies
pip install -e ".[dev,test,docs]"
# Run tests
make test
# Run linting and type checks
make check
# Build documentation
make docs
License
MIT License - See LICENSE for details.
Happy Logging!
Metadata
Release files for lifecyclelogging 202511.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lifecyclelogging-202511.8.0.tar.gz | 21.3 kB | Without provenance | Details for lifecyclelogging-202511.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lifecyclelogging-202511.8.0-py3-none-any.whl | Python 3 | none | any | Details for lifecyclelogging-202511.8.0-py3-none-any.whl |
Total release size: 34.4 kB
Release files / lifecyclelogging-202511.8.0.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | lifecyclelogging-202511.8.0.tar.gz |
|---|---|
| Size | 21.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd112ceeb1b5e273e9ec311c5e1eebafc0b6f48288b84e21c3758e61f045e6f9
|
|
BLAKE2b-256 checksum How to use checksums |
6d9857b5f0f72d0c8dc85a10a8d3d2813ed58397dd192087721a594d488daf0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / lifecyclelogging-202511.8.0-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | lifecyclelogging-202511.8.0-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81073ced4257ec8b6fcf0909b2e45193c5493801f45c69b16251f9963e1af523
|
|
BLAKE2b-256 checksum How to use checksums |
9d4d59bc125cf2a9e36f9fa9f14790957088883c7c47378c0be1f47fa7c79e49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for lifecyclelogging 202511.8.0
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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 2025.11.143 2 files With provenance
- Added 202511.8.0 2 files Without provenance
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.