This logging writes the logs in the Trace Event Format.
pip install trace-event-handler
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.
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*