Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.47 KB

File metadata and controls

51 lines (36 loc) · 1.47 KB

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