Mechanism for selective printing of diagnostic messages
Programs call diag_print(str, code) at points where diagnotistic information
is available. The user of these programs sets diag_codes to some regular expression.
Only when the code argument in diag_print matches the regular expression diag_codes,
then the message is printed. Messages are printed to diag_stream, which defaults to
|diag_selector = <_sre.SRE_Pattern object at 0xb7ec9b60>|
diag_stream = <open file '<stdout>', mode 'w' at 0xb7eb3068>