logging-pipeline


Namelogging-pipeline JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummaryInject logging handler for printing message in the format captured by pipeline
upload_time2025-07-10 05:42:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords ado azure github pipeline
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # logging-pipeline

Python module to inject logging handler for printing message in the format captured by pipeline.

Install with:

```bash
pip install logging-pipeline
```

If logging is imported a handler is added to the root logger to print the error and warning messages
in addition with a format recognized by the pipeline environment executing the script. If the script
is executed outside a pipeline nothing is printed. Supported pipelines are:

- Azure pipelines
- GitHub actions
- User defined by environment variables `LOGGING_PIPELINE_WARNING_MESSAGE_FORMAT` and
  `LOGGING_PIPELINE_ERROR_MESSAGE_FORMAT`. The value is used to configure the python logger with
  `{}`-format, see [LogRecord attributes](https://docs.python.org/3/library/logging.html#logrecord-attributes).
    E.g. `LOGGING_PIPELINE_ERROR_MESSAGE_FORMAT="::%(filename)s:%(lineno)d::%(levelname)s::%(message)s::"`
## Compatibility

`logging-pipeline` uses a live-patching system to target the `logging` library and add a handler.

## PyInstaller

The method used to automatically adding a logging handler relies on a .pth file script that python
loads at startup. This method does not work when a python application is bundled into an executable
with PyInstaller (or similar).
If you want to use this tool in an application built with PyInstaller it will need to be manually
enabled in your application.
This can be done by adding the following line to the top of your main application script:

```python
import logging_pipeline.wrapt_logging
```

This must be run before logging is imported.

## Acknowledgements

The method of patching at runtime is built from the [pip_system_certs](https://pypi.org/project/pip-system-certs/)
module.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "logging-pipeline",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "ADO, Azure, GitHub, Pipeline",
    "author": null,
    "author_email": "Michael F\u00f6rderer <michael.foerderer@gmx.de>",
    "download_url": "https://files.pythonhosted.org/packages/dd/b7/1d6ce1b195d988ba85274e70a0c811c04b7149f15c7d67c0b64fe10a5565/logging_pipeline-0.5.0.tar.gz",
    "platform": null,
    "description": "# logging-pipeline\n\nPython module to inject logging handler for printing message in the format captured by pipeline.\n\nInstall with:\n\n```bash\npip install logging-pipeline\n```\n\nIf logging is imported a handler is added to the root logger to print the error and warning messages\nin addition with a format recognized by the pipeline environment executing the script. If the script\nis executed outside a pipeline nothing is printed. Supported pipelines are:\n\n- Azure pipelines\n- GitHub actions\n- User defined by environment variables `LOGGING_PIPELINE_WARNING_MESSAGE_FORMAT` and\n  `LOGGING_PIPELINE_ERROR_MESSAGE_FORMAT`. The value is used to configure the python logger with\n  `{}`-format, see [LogRecord attributes](https://docs.python.org/3/library/logging.html#logrecord-attributes).\n    E.g. `LOGGING_PIPELINE_ERROR_MESSAGE_FORMAT=\"::%(filename)s:%(lineno)d::%(levelname)s::%(message)s::\"`\n## Compatibility\n\n`logging-pipeline` uses a live-patching system to target the `logging` library and add a handler.\n\n## PyInstaller\n\nThe method used to automatically adding a logging handler relies on a .pth file script that python\nloads at startup. This method does not work when a python application is bundled into an executable\nwith PyInstaller (or similar).\nIf you want to use this tool in an application built with PyInstaller it will need to be manually\nenabled in your application.\nThis can be done by adding the following line to the top of your main application script:\n\n```python\nimport logging_pipeline.wrapt_logging\n```\n\nThis must be run before logging is imported.\n\n## Acknowledgements\n\nThe method of patching at runtime is built from the [pip_system_certs](https://pypi.org/project/pip-system-certs/)\nmodule.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Inject logging handler for printing message in the format captured by pipeline",
    "version": "0.5.0",
    "project_urls": {
        "Github": "https://github.com/spacetown/logging_pipeline",
        "Issues": "https://github.com/spacetown/logging_pipeline/issues"
    },
    "split_keywords": [
        "ado",
        " azure",
        " github",
        " pipeline"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e7155a3d4dd94444f93f62f18932ca91994a895fbd736f5a53dc2ecc09b84b0c",
                "md5": "5bd84b26c39cab5c958764e3ff4bfbef",
                "sha256": "05da4bd443cf591ed6fd3d8429f25fed2196073300ce8740b54f99d0d1f683b8"
            },
            "downloads": -1,
            "filename": "logging_pipeline-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5bd84b26c39cab5c958764e3ff4bfbef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5945,
            "upload_time": "2025-07-10T05:42:45",
            "upload_time_iso_8601": "2025-07-10T05:42:45.114709Z",
            "url": "https://files.pythonhosted.org/packages/e7/15/5a3d4dd94444f93f62f18932ca91994a895fbd736f5a53dc2ecc09b84b0c/logging_pipeline-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ddb71d6ce1b195d988ba85274e70a0c811c04b7149f15c7d67c0b64fe10a5565",
                "md5": "2ade51b5bfab454b55153cc75fcb98ff",
                "sha256": "d5a00fce134b4d1b34a10889e5c9208ebdaf8cb8815a816fca0129d3572c572f"
            },
            "downloads": -1,
            "filename": "logging_pipeline-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2ade51b5bfab454b55153cc75fcb98ff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4922,
            "upload_time": "2025-07-10T05:42:46",
            "upload_time_iso_8601": "2025-07-10T05:42:46.361789Z",
            "url": "https://files.pythonhosted.org/packages/dd/b7/1d6ce1b195d988ba85274e70a0c811c04b7149f15c7d67c0b64fe10a5565/logging_pipeline-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-10 05:42:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "spacetown",
    "github_project": "logging_pipeline",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "logging-pipeline"
}
        
Elapsed time: 1.88327s