~/talk

Using and abusing Python's logging module for more readable logs

Talkat PyBay 2024 · on Saturday, 2024-09-21· [python]
links:none on file
slides:none on file

Custom log level speaker note marks reminders; a log-prefix context injects stable prefixes so interleaved async output still groups correctly; color comes from a string subclass plus a decorator to emit ANSI codes; path objects get sanitized by a replace new lines policy that swaps surprising newlines for visible glyphs; every subprocess invocation is recorded (and stdout/stderr captured) via a wrapper plus Python’s audit framework; huge outputs are abbreviated and full data written to temp files.

AI-written summary · about

  1. 0:00Introduction to logging
  2. 1:27Using less for log viewing
  3. 2:09Avoiding newlines in logs
  4. 2:53Debug level and code logging
  5. 3:55Async logging with prefixes
  6. 4:36Colorizing log output
  7. 5:38Processing log values
  8. 7:04Logging subprocesses
  9. 8:47Abbreviating long logs
  10. 10:10Exception logging
  11. 10:31Conclusion and takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.