Class Debug
Debugger: displays and logs errors.
Behavior is determined by two factors: mode & output
- modes: production / development
- output: HTML / AJAX / CLI / other (e.g. XML)
final public
|
#
__construct(
)
Static class – cannot be instantiated. Static class – cannot be instantiated. |
public static
void
|
#
enable(
mixed
$mode = NULL,
string
$logDirectory = NULL,
string
$email = NULL
)
Enables displaying or logging errors and exceptions. Enables displaying or logging errors and exceptions. Parameters$mode mixed production, development mode, autodetection or IP address(es) whitelist.$logDirectory string error log directory; enables logging in production mode, FALSE means that logging is disabled$email string administrator email; enables email sending in production mode |
public static
bool
|
#
isEnabled(
)
Is Debug enabled? Is Debug enabled? |
public static
void
|
#
log(
string|Exception
$message,
int
$priority = 'info'
)
Logs message or exception to file (if not disabled) and sends email notification (if enabled). Logs message or exception to file (if not disabled) and sends email notification (if enabled). Parameters$message string|Exception$priority int one of constant Debug::INFO, WARNING, ERROR (sends email), CRITICAL (sends email) |
public static
|
#
processException(
Exception
$exception
)
|
public static
void
|
#
toStringException(
Exception
$exception
)
Handles exception throwed in __toString(). Handles exception throwed in __toString(). Parameters$exception Exception |
public static
void
|
#
tryError(
)
Starts catching potential errors/warnings. Starts catching potential errors/warnings. |
public static
bool
|
#
catchError(
ErrorException
& $error
)
Returns catched error/warning message. Returns catched error/warning message. Parameters$error ErrorException catched error |
public static
mixed
|
#
dump(
mixed
$var,
bool
$return = false
)
Dumps information about a variable in readable format. Dumps information about a variable in readable format. Parameters$var mixed variable to dump$return bool return output instead of printing it? (bypasses $productionMode)Returnsmixed variable itself or dump
|
public static
float
|
#
timer(
string
$name = NULL
)
Starts/stops stopwatch. Starts/stops stopwatch. Parameters$name string nameReturnsfloat elapsed seconds
|
public static
void
|
#
addPanel(
IDebugPanel
$panel
)
Add custom panel. Add custom panel. Parameters$panel IDebugPanel |
public static
mixed
|
#
barDump(
mixed
$var,
string
$title = NULL
)
Dumps information about a variable in Nette Debug Bar. Dumps information about a variable in Nette Debug Bar. Parameters$var mixed variable to dump$title string optional titleReturnsmixed variable itself
|
public static
bool
|
#
fireLog(
mixed
$message
)
Sends message to FireLogger console. Sends message to FireLogger console. Parameters$message mixed message to logReturnsbool was successful?
|
DEVELOPMENT |
false # |
PRODUCTION |
true # |
DETECT |
NULL # |
DEBUG |
'debug' # |
INFO |
'info' # |
WARNING |
'warning' # |
ERROR |
'error' # |
CRITICAL |
'critical' # |
static
bool
|
$productionMode | NULL |
in production mode is suppressed any debugging output # |
static
bool
|
$consoleMode | true |
in console mode is omitted HTML output # |
static
int
|
$time | 1302823527.1422 |
timestamp with microseconds of the start of the request # |
static
string
|
$source | 'cli: W:\\Nette\\distribuce\\tools\\apigen\\apigen.php -s NetteFramework-2.0alpha-PHP5.2-nonprefix/Nette -d NetteFramework-2.0alpha-PHP5.2-nonprefix/API-reference' |
requested URI or command line # |
static
int
|
$maxDepth | 3 |
how many nested levels of array/object properties display {@link Debug::dump()} # |
static
int
|
$maxLen | 150 |
how long strings display {@link Debug::dump()} # |
static
int
|
$showLocation | false |
display location? {@link Debug::dump()} # |
static
bool
|
$strictMode | false |
determines whether any error will cause immediate death # |
static
bool
|
$scream | false |
disables the @ (shut-up) operator so that notices and warnings are no longer hidden # |
static
array
|
$onFatalError | array (
) |
of callbacks specifies the functions that are automatically called after fatal error # |
static
string
|
$logDirectory | NULL |
name of the directory where errors should be logged; FALSE means that logging is disabled # |
static
string
|
NULL |
email to sent error notifications # | |
static
callback
|
$mailer | array ( 0 => 'Debug', 1 => 'defaultMailer', ) |
handler for sending emails # |
static
int
|
$emailSnooze | 172800 |
interval for sending email is 2 days # |
static
string
|
$editor | 'editor://open/?file=%file&line=%line' |
URL pattern mask to open editor # |
static
bool
|
$showBar | true |
determines whether show Debug Bar # |