Skip to main content

Inject logging formatter for Azure and GitHub pipelines

Project description

logging_pipeline

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

Install with:

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

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:

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 module.

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

logging_pipeline-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

logging_pipeline-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file logging_pipeline-0.1.0.tar.gz.

File metadata

  • Download URL: logging_pipeline-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for logging_pipeline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8761232e75973d321cd65ab0cd257e4602df08a7fc334a52a8ee75c172d5c8ad
MD5 a56c44b27e1c6b1311370185ddc33707
BLAKE2b-256 0cfb0b218f36c06cf61c2f03b6560c29b3a9401af80445effda1bc783285b45b

See more details on using hashes here.

File details

Details for the file logging_pipeline-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for logging_pipeline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 842a216d51285757583668948be9630a68c96e367c6737a2511465956871dfa1
MD5 4a1a05ea25411b05f51a0424de296d20
BLAKE2b-256 0b53756edf855abd7fa50005007c9e7615cb7f8fed17c9e6904badcbeabd01e1

See more details on using hashes here.

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