View variables on admin/watchbug with devel's krumo style output

The module provides a central opportunity for sending debug information (most cases php-variables) to the system and directly output it or store it for delayed output. This can be very helpful for example when trying to debug HTTP requests or AJAX implementations.

With different submodules you can select different types of storage (watchbug_variables, watchbug_wd) and different output formats (watchbug_devel, watchbug_print, watchbug_firebug). There can also be applied pre and post processors for storage and loading (watchbug_stdobject)

To use watchbug you have to call watchbug($variable,$key = NULL). Then the different implementations allow you to inspect the passed variable on admin/watchbug (e.g. in Krumo Style provided by devel.module).
There is at least one active storage module and one display module needed, to view data on admin/watchbug.
To clear the current watchbug variable watchbug_clear() can be called. Aliases for the two functions are wb() and wbc().

When activated AdminMenu the display page admin/watchbug can easily be accessed via toplevel link in the bar.

This module is an advancement of firep_hold (http://derhasi.de/node/29).

Implementations

watchbug.module itself only provides the API/hooks. You need at least one storage module and one output module to be able to work with watchbug. If you use more than one module of each type, variables will be stored and outputed more than once each time watchbug variables will be viewed or saved.
There are a third and fourth type of module that (3) handles pre and post processing of variables or (4) act as an alias.
The containing modules are listed above with according markers.

WatchBug Variables (storage)

watchbug_variables.module
Provides a simple storage function that uses variable_get() and variable_set() for loading and saving.

WatchBug Print (output)

watchbug_print.module
Provides a simple output by using print_r

WatchBug StandardObject (pre save)

watchbug_stdobject.module
Converts any kind of object to a stdClass object before saving. This is necessary for some modules that use serialize before storage, because objects like simpleXMLObject will causes errors.

WatchBug Devel (output)

watchbug_devel.module - dependency on Devel
Uses krumo style output for displaying the values

WatchBug DrupalForFirebug (output)

watchbug_firebug.module - dependency on Drupal For Firebug
Provides direct and delayed output with DrupalForFirebug's firep(), for showing data in the Firebug Drupal Panel.

WatchBug Watchdog (alias) (storage)

watchbug_wd.module
- Provides the opportunity to fire watchbug($var,key) via watchdog("watchbug",$key,$var), so code also works if watchbug.module is disabled.
- storage functionality is provided through dblog.module (part of drupal core) in {watchdog} table

WatchBug JS (alias)

watchbug_js.module
This module adds a javascript function watchbug(value, key) to the environment, so watchbug can also be fired in js codes. Thanks to stBorchert for creating this module.

Hooks

You can add new processors, storage and viewing options by using the following hooks:

hook_watchbug($op,&$val)

Operators $op
* 'pre save'
* 'save'
* 'load'
* 'post load'
* 'view'

hook_watchbug_alter($watchbug_form)

more information in HOOKS.txt

You are welcome to review and add new modules.

Development on Watchbug is sponsored by undpaul.
----

Project Information

Downloads