April 2024 - This site, and Kamaelia are being updated. There is significant work needed, and PRs are welcome.

Axon.debug.debug

For examples and more explanations, see the module level docs.


class debug(object)

debug([assertBadDebug]) -> new debug object.

Object for outputting debugging output, filtered as required. Only outputs debugging data for section names it recognises - as specified in a debug config file.

Keyword arguments:

  • assertBadDebug -- Optional. If evaluates to true, then any debug output for an unrecognised section (as defined in the configuration) causes an exception (default=1)

Methods defined here

__init__(self[, assertBadDebug])

addDebug(self, **debugSections)

Add several debug sections. Each argument's name corresponds to a section name fo rwhich debug output can be generated. The value is the maximum debug level for which there will be output.

This does not affect the configuration of other debug objects.

addDebugSection(self, section, level)

Add a section name for which debug output can be generated, specifying a maximum debug level for which there will be output.

This does not affect the configuration of other debug objects.

areDebugging(self, section, level)

Returns true if we are debugging this level, doesn't try to enforce correctness

debug(self, section, level, *message)

Output a debug message.

Specify the 'section' the debug message should come under. The user will have specified the maximum 'level' to be outputted for that section.

  • Use higher level numbers for more detailed debugging output.
  • Use different section names for different parts of your code to allow the user to select which sections they want output for

Always returns True, so can be used as argument to an assert statement. This means you can then disable debugging output (and any associated performance overhead) by using python's "-O" command line flag.

Keyword arguments:

  • section -- the section you want this debugging output classified under
  • level -- the level of detail of this debugging output (number)
  • *message -- object(s) to print as the debugging output

debugmessage(self, section, *message)

Output a debug messge (never filtered)

Keyword arguments:

  • section --
  • *message -- object(s) to print as the debugging output

decreaseDebug(self, section)

Decreases the maximum debug level for which output will be generated for the specified section.

This does not affect the configuration of other debug objects.

increaseDebug(self, section)

Increases the maximum debug level for which output will be generated for the specified section.

This does not affect the configuration of other debug objects.

note(self, section, level, *message)

Output a debug message.

Specify the 'section' the debug message should come under. The user will have specified the maximum 'level' to be outputted for that section.

  • Use higher level numbers for more detailed debugging output.
  • Use different section names for different parts of your code to allow the user to select which sections they want output for

Always returns True, so can be used as argument to an assert statement. This means you can then disable debugging output (and any associated performance overhead) by using python's "-O" command line flag.

Keyword arguments:

  • section -- the section you want this debugging output classified under
  • level -- the level of detail of this debugging output (number)
  • *message -- object(s) to print as the debugging output

readConfig(self[, configFile])

INTERNAL Reads specified debug configuration file.

Uses Axon.debugConfigFile

setDebugSections(self, **debugSections)

Set the debug sections. Replaces any existing ones.

Each argument's name corresponds to a section name fo rwhich debug output can be generated. The value is the maximum debug level for which there will be output.

This does not affect the configuration of other debug objects.

useConfig(self[, filename])

Instruct this object to set up its debugging configuration.

If this, or another debug object has previously set it up, then that is applied for this object; otherwise it is loaded from the specified file. However, if no file is specified or the file could not be read, then alternative defaults are used. This configuration is then used for all future debug objects.

Feedback

Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!

Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.

-- Automatic documentation generator, 09 Dec 2009 at 04:00:25 UTC/GMT