All applications use some kind of debugging.



This is a long line of text.


Parameters:globs – dictionary of module globals

This function, posing as an instance creator, returns a ...

Function Decorators


This function decorates a function with instances of buggers that are named by the function name combined with the module name. It is used like this:

def some_function(arg):
    if _debug: some_function._debug("some_function %r", arg)
    # rest of code

This results in a bugger called module.some_function that can be accessed by that name when attaching log handlers.


This should really be called debug_function or something like that.


class debugging.DebugContents

This is a long line of text.


This is a long line of text.

debug_contents(indent=1, file=sys.stdout, _ids=None)
  • indent – function to call
  • file – regular arguments to pass to fn
  • _ids – keyword arguments to pass to fn

This is a long line of text.

class debugging.LoggingFormatter(logging.Formatter)

This is a long line of text.


This is a long line of text.

Parameters:record (logging.LogRecord) – record to format

This function converts the record into a string. It uses the regular formatting function that it overrides, then if any of the parameters inherit from DebugContents (or duck typed by providing a debug_contents function) the message is extended with the deconstruction of those parameters.

class debugging.Logging

This is a long line of text.


Now that Python supports class decorators, this should really be a class decorator called debug_class or something like that.