A topic-centered debugging facility #28
Labels
No labels
blocked
bug
ciritical
code improvement
duplicate
feature
in progress
low
normal
research
spec change
ui
urgent
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
w21/jpylib#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For more complex applications, a simple overall debug/verbosity level is not helpful when you want to see some aspects of the application more detailed and others not. I have used a debug flag/topic based approach as early as 1999 (that mail thing) with success. Of course in C, it wasn't easy to implement this generically, and I didn't even try that (but had a table-driven easily extensible approach). In Python it is, so I'll do it.
The idea is that I have a number of debug flags or topics (I'll stick to the latter term here) that are defined beforehand. This way we can conventiently use
debug.<topic>(*things)from the start and need not check if that exists or use a clumsier syntax (as in e.g.debug("topic", *things)) to address a topic.Functions could look like this, using string Tokens for topic indentifiers:
Or a debugger class/object on which topics can be defined:
Topics can then be switched on/off e.g. via command line options or some run time mechanism like a CLI or API.
assigned to @ni