Metadata-Version: 2.4
Name: gpclog
Version: 0.3.0
Summary: General Purpose Category Logger - A Python library for managing categorized logs in complex projects.
Project-URL: Homepage, https://github.com/linnetcodes/gpclog
Project-URL: Documentation, https://linnetcodes.github.io/gpclog
Project-URL: Repository, https://github.com/linnetcodes/gpclog
Project-URL: Issues, https://github.com/linnetcodes/gpclog/issues
Author-email: Linnet Codes <linnet.codes@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: categorized-logging,gpconfig,logging,loguru,python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Logging
Requires-Python: >=3.10
Requires-Dist: gpconfig>=0.3.0
Requires-Dist: loguru>=0.7.0
Provides-Extra: dev
Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
Requires-Dist: mkdocs-static-i18n>=1.2; extra == 'dev'
Requires-Dist: mkdocs>=1.6; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# gpclog

[简体中文](README.zh-CN.md) | 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

```bash
pip install gpclog
```

## Quick Start

> **Note (import side effect):** importing `gpclog` constructs its singleton
> manager, which calls `loguru.logger.remove()` and **clears any pre-existing
> loguru handlers**. If you configure loguru yourself, do so *after* importing
> `gpclog`.

### Basic Usage

```python
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

```python
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:

```bash
mkdocs build --clean --strict
```

Preview the documentation locally:

```bash
mkdocs serve
```

## API Reference

See:

- [Docs home](docs/index.md)
- [gpclog module](docs/gpclog.md)
- [GPCLogger](docs/logger.md)
- [GPCLoggerConfig](docs/config.md)

## License

MIT
