Class webdebugger

Description

The debugger class. Responsible for accumulating, filtering and then

rendering debug content to various outputs. This class is automatically instantiated by the system as $RESPONSE->debugger; and is used by various modules (eg. query) to log information. It can also be used as either an ad-hoc debugging aid, or as an analysis tool where debug output statements are inserted into code and left there permanently, their output only switched on when problems arise. Various classes of debug output can be enabled in any combination by OR'ing the following constants when the debug_on() function is called: DBG_DEBUG Ad-hoc debugging output DBG_DIAGNOSTIC Diagnostic output DBG_SQL SQL queries to database DBG_SQLDATA SQL SELECT data from database DBG_DUMP Dump HTTP and PHP page vars DBG_TRACE Provide debug traceback info DBG_TABLES Show table borders and validate cells DBG_PROFILES Show process profiling information DBG_AUTH Authentication messages DBG_DEFAULT DEBUG and DIAGNOSTICS only DBG_ALL Everything (verbose!) eg. debug_on(DBG_SQL | DBG_DIAGNOSTIC | DBG_DUMP);

Located in /debugger.php (line 101)

RenderableObject
   |
   --webdebugger
Variable Summary
 mixed $content
 mixed $debugclass
 mixed $enabled
 mixed $output_mode
 mixed $profile
 mixed $trace
 mixed $tracedepth
Method Summary
 webdebugger webdebugger ([integer $debugclass = DBG_DEFAULT])
 void debug_class (integer $debugclass)
 void debug_mode ([boolean $enabled = true], [integer $debugclass = DBG_UNDEFINED])
 void debug_output ([integer $mode = DBG_O_DEFAULT])
 void debug_write (string $content, [integer $debugclass = DBG_DIAGNOSTIC])
 string html ()
 void profile (string $label)
 void profiling ()
 string report_classes ()
 void send_to_file (string $name, [string $dir = ""])
 string traceback ()
 string wml ()
Variables
mixed $content = "" (line 104)

Accumulated debugging output content

mixed $debugclass = DBG_DEFAULT (line 106)

Classes of debugging to accumulate

mixed $enabled = false (line 108)

Status of the debugger

mixed $output_mode = DBG_O_DEFAULT (line 110)

Modes of output for debugging content

mixed $profile = array() (line 124)

Profiler data array

mixed $profile_timer (line 121)

Microtimer object for profiling

mixed $trace = array() (line 115)

Array of traced locations

mixed $tracedepth = 0 (line 118)

Depth of tracing

Methods
Constructor webdebugger (line 131)

Constructor

webdebugger webdebugger ([integer $debugclass = DBG_DEFAULT])
  • integer $debugclass: The classes of output to render
debug_class (line 211)

Set debug class(es) to accept

void debug_class (integer $debugclass)
  • integer $debugclass: Class of output
debug_hascontent (line 138)

Return whether we have any content, true or false.

void debug_hascontent ()
debug_mode (line 226)

Set debug mode

Set debug output to be enabled(default)/disabled

void debug_mode ([boolean $enabled = true], [integer $debugclass = DBG_UNDEFINED])
  • boolean $enabled: If true enable debugger, else disable it
  • integer $debugclass: Class of output to accept
debug_output (line 165)

Set debug output mode

This function starts/stops the debugger from echoing the content directly as well as storing it for a subsequent display by webpage-defs.php. The values which can be OR'ed together are as follows: DBG_O_NONE No output DBG_O_STORED Output stored in $content DBG_O_ECHO Output via direct echo DBG_O_CLI Output for CLI: echoed tag-stripped ASCII, LF end-of-line DBG_O_LOG Output to system log DBG_O_LOGFILE To logfile (not implemented yet) DBG_O_DEFAULT Default output mode (echoed) DBG_O_ALL Ubiquitous output mode

void debug_output ([integer $mode = DBG_O_DEFAULT])
  • integer $mode: Output mode of debugger
debug_write (line 176)

Set debug output mode Register content for debugging output. Check that it is of an acceptable class and direct it all to the right place(s).

void debug_write (string $content, [integer $debugclass = DBG_DIAGNOSTIC])
  • string $content: Content to add to debug output buffer
  • integer $debugclass: Class of output
html (line 399)

Use render() to render the debugger output.

Renders the debugger output content as HTML.

string html ()

Redefinition of:
RenderableObject::html()
Return output suitable for normal HTML-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to web browsers.
profile (line 251)

Profile breakpoint.

Profiling allows you to ascertain the elapsed time between two breakpoints. To do this just call this method twice with the same label.

void profile (string $label)
  • string $label: A label for this profile breakpoint
profiling (line 300)

Returns true if this debugger is in profiling mode.

void profiling ()
report_classes (line 308)

List classes debugger is accepting

  • return: List of classes acceptable to the debugger
string report_classes ()
send_to_file (line 586)

Send debug output to a file.

void send_to_file (string $name, [string $dir = ""])
  • string $name: Filename to put output into
  • string $dir: Directory/path to put file into
traceback (line 378)

Traceback list Return a string of the form "label->label->label" forming the traceback level labels in order.

  • return: Traceback list
string traceback ()
wml (line 531)

Use render() to render the debugger output.

Renders the debugger output content as WML.

string wml ()

Redefinition of:
RenderableObject::wml()
Return output suitable for normal wap-capable device. This method must be over-ridden by a method of the same name in the descendant class which renders output to wap devices.

Inherited Methods

Inherited From RenderableObject

 RenderableObject::RenderableObject()
 RenderableObject::html()
 RenderableObject::render()
 RenderableObject::wml()
 RenderableObject::wmlup()
 RenderableObject::xml()

Documentation generated by phpDocumentor 1.3.0RC3