PEAR Manual
Prev |  | Next

# ->debug()

->debug() -- output debug information.

## Synopsis

``void $DB_DataObject->debug` (string $message [, string $logPrefix [, integer $level=1]])`

## Description

Debugger - you can use this in your extended classes to output debugging information. Uses DB_DataObject::DebugLevel(x) to turn it on, and can be completly turned off by using the production setting in the configuration file

## Parameter

- `string $message` - message to output

- `integer $logtype` - A bold prefix string

- `integer $level` - output level, 1 is general, 5 tends to reveal things like database connection passwords..

## Note

This function can not be called statically.

Warning
In production mode, the debugger is disabled

## See

DB_DataObject::debugLevel()

## Example

Example 33-1. Setting the debugging level
    $person = new DataObjects_Person;
    $person->get(12);

    // always prints
    $person->debug('just got the person, about to set stuff', 'my application',0);
    $person->setFrom($_POST['input']);

    // only prints if debuglevel is set
    $person->debug('just set the variables, about to update', 'my application',1);
    $person->update();

Prev | Home | Next
DB_DataObject::debugLevel | Up | DB_DataObject::raiseError