Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpclog-0.2.0.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpclog-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

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

Hashes for gpclog-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c84b2fa4f840a37d2932fcd63625327455b1c9e0f9a4748a2a391b7d2fcb68b2
MD5 ed6f08d7084aa5ac0cb37f34411be19e
BLAKE2b-256 e456d395f86c8f7fe5c6a82a635a5ec1adfe3d5b1da1deb3af9f53121df101bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpclog-0.2.0.tar.gz:

Publisher: python-publish.yml on LinnetCodes/gpclog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gpclog-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ed3960908940375522ffdb24d99c9b4dca7b36c70dd48efc2a6cfa07b7889d0
MD5 489b92eb78796e9e81c0d8d6b91bc204
BLAKE2b-256 ad095386ec0dd0d0e7f8b6916cadf2af16eb6aa6d14b3e94198016d48b9cb80f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gpclog-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on LinnetCodes/gpclog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page