Skip to main content

Python Logging Handler which dumps in the Trace Event Format supported by Chromium based browsers.

Project description

PyPI - Python Version PyPI PyPI - License PyPI - Downloads Python package

Logging Handler writing Trace Event Format

This logging writes the logs in the Trace Event Format.

Screenshot

Installation

pip install trace-event-handler

Usage

import logging
from trace_event_handler import TraceEventHandler

handler = TraceEventHandler()
logging.basicConfig(
    handlers=[
        logging.StreamHandler(None),
        handler
    ]
)

# Do your stuff and log it
# ...

# Dump the trace to file
handler.dump('trace.json')

Open your Chromium based browser and navigate to chrome://tracing. Click on Load and select your dumped trace file.

The example leads to the trace seen in the figure above.

Publishing manually

python3 setup.py sdist bdist_wheel
python3 -m twine upload  dist/*

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

trace_event_handler-0.0.4.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

trace_event_handler-0.0.4-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

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