gc3libs.debug — gc3pie development (SVN $Revision$) documentation

### Navigation

- index
- modules |
- next |
- previous |
- gc3pie development (SVN $Revision$) documentation »
- Programmer Documentation »
- GC3Libs programming API »

# gc3libs.debug

Tools for debugging GC3Libs based programs.

Part of the code used in this module originally comes from:
  - http://wordaligned.com/articles/echo

`gc3libs.debug.` `format_arg_value`(arg_val)

  Return a string representing a (name, value) pair.

  Example:

      >>> format_arg_value(('x', (1, 2, 3)))
      'x=(1, 2, 3)'

`gc3libs.debug.` `is_class_private_name`(name)

  Determine if a name is a class private name.

`gc3libs.debug.` `is_classmethod`(instancemethod)

  Determine if an instancemethod is a classmethod.

`gc3libs.debug.` `method_name`(method)

  Return a method’s name.

  This function returns the name the method is accessed by from outside the class (i.e. it prefixes “private” methods appropriately).

`gc3libs.debug.` `name`(item)

  Return an item’s name.

`gc3libs.debug.` `trace`(fn, log=<bound method Logger.debug of <logging.Logger instance at 0x37c1ea8>>)

  Logs calls to a function.

  Returns a decorated version of the input function which “echoes” calls made to it by writing out the function’s name and the arguments it was called with.

`gc3libs.debug.` `trace_class`(cls, log=<bound method Logger.debug of <logging.Logger instance at 0x37c1ea8>>)

  Trace calls to class methods and static functions

`gc3libs.debug.` `trace_instancemethod`(cls, method, log=<bound method Logger.debug of <logging.Logger instance at 0x37c1ea8>>)

  Change an instancemethod so that calls to it are traced.

  Replacing a classmethod is a little more tricky. See: http://www.python.org/doc/current/ref/types.html

`gc3libs.debug.` `trace_module`(mod, log=<bound method Logger.debug of <logging.Logger instance at 0x37c1ea8>>)

  Trace calls to functions and methods in a module.

### Navigation

- index
- modules |
- next |
- previous |
- gc3pie development (SVN $Revision$) documentation »
- Programmer Documentation »
- GC3Libs programming API »