ss-utils-logging


Namess-utils-logging JSON
Version 0.0.7 PyPI version JSON
download
home_pageNone
SummaryUtilities for logging with orjson serialization and advanced features
upload_time2025-08-14 03:38:12
maintainerNone
docs_urlNone
authorshern
requires_python>=3.10
licenseMIT
keywords configuration logging orjson yaml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ss-utils-logging

A Python logging utility package with orjson serialization and advanced configuration features.

## Features

- **ORJSON Serialization**: High-performance JSON logging with orjson
- **YAML Configuration**: Easy logging setup using YAML configuration files
- **Merging Logger Adapter**: Advanced adapter that properly merges extra fields (fixes Python <3.13 limitation)
- **Console & JSON Formatters**: Flexible formatting options for different output needs
- **Config File Generation**: Automatically generate example configuration files

## Installation

```bash
uv add ss-utils-logging
```

## Quick Start

```python
from ss_utils_logging import configure_logging, get_logger, generate_config_files

# [one-time] Generate example configuration files in `config/` folder
# This creates example YAML configuration files that you can customize for your needs.
generate_config_files("config")

# Configure logging with YAML file
configure_logging("config/logging.yaml")

# Set up a logger with extra context
logger = get_logger(__name__, extra={"service": "my-app", "version": "1.0.0"})

# Log with additional context (optional)
logger.info("Processing request", user_id=123, action="login")
```

## Key Components

### MergingLoggerAdapter
Fixes the Python <3.13 limitation where LoggerAdapter doesn't properly merge extra fields from both the adapter and individual log calls.

### Formatters
- `ConsoleFormatter`: Human-readable console output
- `ORJSONFormatter`: High-performance JSON output using orjson

### Configuration Management
- `configure_logging()`: Set up logging from YAML configuration
- `generate_config_files()`: Create example configuration files
- `get_logger()`: Get logger instances with optional extra context


## Test notes

- Tested only on macos

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ss-utils-logging",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "configuration, logging, orjson, yaml",
    "author": "shern",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b8/85/d4c59ce59900638efc757784be20d0c0b434f835c39010a84c778d8609d7/ss_utils_logging-0.0.7.tar.gz",
    "platform": null,
    "description": "# ss-utils-logging\n\nA Python logging utility package with orjson serialization and advanced configuration features.\n\n## Features\n\n- **ORJSON Serialization**: High-performance JSON logging with orjson\n- **YAML Configuration**: Easy logging setup using YAML configuration files\n- **Merging Logger Adapter**: Advanced adapter that properly merges extra fields (fixes Python <3.13 limitation)\n- **Console & JSON Formatters**: Flexible formatting options for different output needs\n- **Config File Generation**: Automatically generate example configuration files\n\n## Installation\n\n```bash\nuv add ss-utils-logging\n```\n\n## Quick Start\n\n```python\nfrom ss_utils_logging import configure_logging, get_logger, generate_config_files\n\n# [one-time] Generate example configuration files in `config/` folder\n# This creates example YAML configuration files that you can customize for your needs.\ngenerate_config_files(\"config\")\n\n# Configure logging with YAML file\nconfigure_logging(\"config/logging.yaml\")\n\n# Set up a logger with extra context\nlogger = get_logger(__name__, extra={\"service\": \"my-app\", \"version\": \"1.0.0\"})\n\n# Log with additional context (optional)\nlogger.info(\"Processing request\", user_id=123, action=\"login\")\n```\n\n## Key Components\n\n### MergingLoggerAdapter\nFixes the Python <3.13 limitation where LoggerAdapter doesn't properly merge extra fields from both the adapter and individual log calls.\n\n### Formatters\n- `ConsoleFormatter`: Human-readable console output\n- `ORJSONFormatter`: High-performance JSON output using orjson\n\n### Configuration Management\n- `configure_logging()`: Set up logging from YAML configuration\n- `generate_config_files()`: Create example configuration files\n- `get_logger()`: Get logger instances with optional extra context\n\n\n## Test notes\n\n- Tested only on macos\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Utilities for logging with orjson serialization and advanced features",
    "version": "0.0.7",
    "project_urls": {
        "Homepage": "https://github.com/shern2/ss-utils-logging",
        "Issues": "https://github.com/shern2/ss-utils-logging/issues",
        "Repository": "https://github.com/shern2/ss-utils-logging"
    },
    "split_keywords": [
        "configuration",
        " logging",
        " orjson",
        " yaml"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "446fa1c460e52e8eb42e17dfcdeab02d7a4964fff88556db31e54cf5e3acd52e",
                "md5": "b2a563db1b03861d68548140e921cc64",
                "sha256": "b9edad6791faf4754c67bbc47cc0e32d39f48fe0ea27286ce0711e5981054441"
            },
            "downloads": -1,
            "filename": "ss_utils_logging-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b2a563db1b03861d68548140e921cc64",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 7947,
            "upload_time": "2025-08-14T03:38:10",
            "upload_time_iso_8601": "2025-08-14T03:38:10.794023Z",
            "url": "https://files.pythonhosted.org/packages/44/6f/a1c460e52e8eb42e17dfcdeab02d7a4964fff88556db31e54cf5e3acd52e/ss_utils_logging-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b885d4c59ce59900638efc757784be20d0c0b434f835c39010a84c778d8609d7",
                "md5": "7fe72191d2008334c7d13b60a7648040",
                "sha256": "69477996a53c5178ed20ebd8c99557a51a05022e521aa782c4e903ba99e44395"
            },
            "downloads": -1,
            "filename": "ss_utils_logging-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "7fe72191d2008334c7d13b60a7648040",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 102889,
            "upload_time": "2025-08-14T03:38:12",
            "upload_time_iso_8601": "2025-08-14T03:38:12.569628Z",
            "url": "https://files.pythonhosted.org/packages/b8/85/d4c59ce59900638efc757784be20d0c0b434f835c39010a84c778d8609d7/ss_utils_logging-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-14 03:38:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shern2",
    "github_project": "ss-utils-logging",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ss-utils-logging"
}
        
Elapsed time: 0.53342s