gpclog
简体中文 | English
General Purpose Category Logger - A Python library for managing categorized logs in complex projects.
Features
- Category-based Logging - Each category has its own configuration and file
- Built on loguru - High-performance, feature-rich logging core
- Built on gpconfig - Type-safe configuration management
- Smart Defaults - Works out of the box with zero configuration
- Auto Class Registration - Automatically registers with GPConfigManager on import
Installation
pip install gpclog
Quick Start
Note (import side effect): importing
gpclogconstructs its singleton manager, which callsloguru.logger.remove()and clears any pre-existing loguru handlers. If you configure loguru yourself, do so after importinggpclog.
Basic Usage
import gpclog
# Get a category logger (zero configuration)
logger = gpclog.get_logger("my_category")
logger.info("Hello, gpclog!")
# Output to: ~/gpclog_output/my_category.log
Using Configuration Files
import gpclog
from gpconfig import GPConfigManager
# Initialize GPConfigManager (GPCLoggerConfig and GPCLogger are auto-registered)
manager = GPConfigManager("myapp")
# Method 1: Using gpclog public API
logs_folder = manager.get_config("logs")
gpclog.set_config_folder(logs_folder)
logger = gpclog.get_logger("database")
# Method 2: Using GPConfigManager directly
logger = manager.get_object("logs.database")
Configuration schema, multiprocess usage, rotation/retention, and API details are documented in docs/.
Documentation
Build and validate the documentation locally:
mkdocs build --clean --strict
Preview the documentation locally:
mkdocs serve
API Reference
See:
License
MIT
Metadata
Release files for gpclog 0.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 | |
|---|---|---|---|---|
| gpclog-0.3.1.tar.gz | 41.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gpclog-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.6 kB
Release files / gpclog-0.3.1.tar.gz
| Download URL | gpclog-0.3.1.tar.gz |
|---|---|
| Size | 41.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e57795e40335cb8e6e731b3f0073985b05a332f178f1e7b96a60ef2c8644a736
|
|
BLAKE2b-256 checksum How to use checksums |
74a85aa2183fb50fd0f559f6af49a88a9211ceffc79ea81b31759f2c65181107
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logRelease files / gpclog-0.3.1-py3-none-any.whl
| Download URL | gpclog-0.3.1-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f60e470cff9a7f6fe3f14e3b9c9e71f29854eff20ad5618cac1f04383449dc4a
|
|
BLAKE2b-256 checksum How to use checksums |
b99ec6251189fe9052dcbf8fbd1c0aa378719f67179feef2b2191528fd0438d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for gpclog 0.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for gpclog-0.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA 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.