Skip to content

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

License

Notifications You must be signed in to change notification settings

lochbrunner/trace_event_handler

Repository files navigation

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/*

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages