General Purpose Category Logger - A Python library for managing categorized logs in complex projects.
Project description
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
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:
venv/bin/mkdocs build --clean --strict
Preview the documentation locally:
venv/bin/mkdocs serve
API Reference
See:
License
MIT
Project details
Release history Release notifications | RSS feed
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 gpclog-0.2.0.tar.gz.
File metadata
- Download URL: gpclog-0.2.0.tar.gz
- Upload date:
- Size: 30.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c84b2fa4f840a37d2932fcd63625327455b1c9e0f9a4748a2a391b7d2fcb68b2
|
|
| MD5 |
ed6f08d7084aa5ac0cb37f34411be19e
|
|
| BLAKE2b-256 |
e456d395f86c8f7fe5c6a82a635a5ec1adfe3d5b1da1deb3af9f53121df101bf
|
Provenance
The following attestation bundles were made for gpclog-0.2.0.tar.gz:
Publisher:
python-publish.yml on LinnetCodes/gpclog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpclog-0.2.0.tar.gz -
Subject digest:
c84b2fa4f840a37d2932fcd63625327455b1c9e0f9a4748a2a391b7d2fcb68b2 - Sigstore transparency entry: 1363868104
- Sigstore integration time:
-
Permalink:
LinnetCodes/gpclog@227921b6e9567d22b279bb3fae2b08733a40c6db -
Branch / Tag:
refs/tags/version-0.2.0r1 - Owner: https://github.com/LinnetCodes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@227921b6e9567d22b279bb3fae2b08733a40c6db -
Trigger Event:
release
-
Statement type:
File details
Details for the file gpclog-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gpclog-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ed3960908940375522ffdb24d99c9b4dca7b36c70dd48efc2a6cfa07b7889d0
|
|
| MD5 |
489b92eb78796e9e81c0d8d6b91bc204
|
|
| BLAKE2b-256 |
ad095386ec0dd0d0e7f8b6916cadf2af16eb6aa6d14b3e94198016d48b9cb80f
|
Provenance
The following attestation bundles were made for gpclog-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on LinnetCodes/gpclog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gpclog-0.2.0-py3-none-any.whl -
Subject digest:
9ed3960908940375522ffdb24d99c9b4dca7b36c70dd48efc2a6cfa07b7889d0 - Sigstore transparency entry: 1363868110
- Sigstore integration time:
-
Permalink:
LinnetCodes/gpclog@227921b6e9567d22b279bb3fae2b08733a40c6db -
Branch / Tag:
refs/tags/version-0.2.0r1 - Owner: https://github.com/LinnetCodes
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@227921b6e9567d22b279bb3fae2b08733a40c6db -
Trigger Event:
release
-
Statement type: