PyCon 2016 in Portland, Or
hills next to breadcrumb illustration

Tuesday 12:10 p.m.–12:40 p.m.

How I built a power debugger out of the standard library and things I found on the internet

Doug Hellmann

Audience level:
Novice
Category:
Best Practices & Patterns

Description

Smiley spys on your application, recording everything it does, using Python's built-in tracing facility and a database to create a complete record of your program's runtime so you can study it. Most of the tools I used to create Smiley are in Python's standard library, and the history of Smiley's development serves as a framework to discuss those tools and how you can tap their power yourself.

Abstract

Smiley demonstrates how to use Python's native tracing capabilities to monitor not just what parts of your program run, but the data flowing through the program as it runs. All of the data is recorded for study after the program exits, which means you can pass different inputs and then compare the results of the runs. In this presentation, I describe the evolution of Smiley, from concept through internal API changes as I worked on the implementation. I also talk about tracing Python programs in general, and explain how the trace code in Smiley can be used to send trace data to different output destinations.