Class Debug (namespace Nette)


Debug static class.


Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Debug.php (line 37)
Public Method Summary
Debug
Static class - cannot be instantiated.
static void
addColophon (callback $callback)
Add custom descriptions.
static mixed
consoleDump (mixed $var, [string $title = NULL])
Dumps information about a variable in Nette Debug Console.
static void
Disables profiler.
static mixed
dump (mixed $var, [bool $return = FALSE])
Dumps information about a variable in readable format.
static void
enable ([mixed $mode = NULL], [string $logFile = NULL], [array|string $email = NULL])
Enables displaying or logging errors and exceptions.
static void
Enables profiler.
static mixed
fireDump (mixed $var, string $key)
Sends variable dump to Firebug tab request/server.
static bool
fireLog (mixed $message, [string $priority = self::LOG], [string $label = NULL])
Sends message to Firebug console.
static void
Unregister error handler routine.
static void
processException ($exception, [bool $outputAllowed = FALSE])
Logs or displays exception.
static elapsed
timer ([string $name = NULL])
Starts/stops stopwatch.
Constant Summary
null DETECT NULL

line 73

server modes Debug::enable()
bool DEVELOPMENT FALSE

line 71

server modes Debug::enable()
string ERROR 'ERROR'

line 126

FirePHP log priority
string EXCEPTION 'EXCEPTION'

line 128

FirePHP log priority
string GROUP_END 'GROUP_END'

line 130

FirePHP log priority
string GROUP_START 'GROUP_START'

line 129

FirePHP log priority
string INFO 'INFO'

line 124

FirePHP log priority
string LOG 'LOG'

line 123

FirePHP log priority
bool PRODUCTION TRUE

line 72

server modes Debug::enable()
string TRACE 'TRACE'

line 127

FirePHP log priority
string WARN 'WARN'

line 125

FirePHP log priority
Variable Summary
static bool $consoleMode

line 43

determines whether a server is running in console mode
static array $counters array()

line 118

free counters for your usage
static int $emailSnooze 172800

line 86

interval for sending email is 2 days
static callback $mailer array(__CLASS__, 'defaultMailer')

line 83

static int $maxDepth 3

line 60

how many nested levels of array/object properties display Debug::dump()
static int $maxLen 150

line 63

how long strings display Debug::dump()
static array $onFatalError array()

line 80

of callbacks specifies the functions that are automatically called after fatal error
static bool $productionMode

line 40

determines whether a server is running in production mode
static int $showLocation FALSE

line 66

display location? Debug::dump()
static bool $strictMode FALSE

line 77

determines whether to consider all errors as fatal
static int $time

line 46


Method Details

line 138

__construct

public Debug __construct ()

Static class - cannot be instantiated.

Output
Debug  

line 774

addColophon

public static void addColophon (callback $callback)

Add custom descriptions.

Input
callback $callback
Output
void  

line 277

consoleDump

public static mixed consoleDump (mixed $var, [string $title = NULL])

Dumps information about a variable in Nette Debug Console.

Input
mixed $var variable to dump
string $title optional title
Output
mixed variable itself

line 758

disableProfiler

public static void disableProfiler ()

Disables profiler.

Output
void  

line 240

dump

public static mixed dump (mixed $var, [bool $return = FALSE])

Dumps information about a variable in readable format.

Input
mixed $var variable to dump
bool $return return output instead of printing it? (bypasses $productionMode)
Output
mixed variable itself or dump

line 423

enable

public static void enable ([mixed $mode = NULL], [string $logFile = NULL], [array|string $email = NULL])

Enables displaying or logging errors and exceptions.

Input
mixed $mode production, development mode or autodetection
string $logFile error log file (FALSE disables logging in production mode)
array|string $email administrator email or email headers; enables email sending in production mode
Output
void  

line 747

enableProfiler

public static void enableProfiler ()

Enables profiler.

Output
void  

line 849

fireDump

public static mixed fireDump (mixed $var, string $key)

Sends variable dump to Firebug tab request/server.

Input
mixed $var variable to dump
string $key unique key
Output
mixed variable itself

line 864

fireLog

public static bool fireLog (mixed $message, [string $priority = self::LOG], [string $label = NULL])

Sends message to Firebug console.

Input
mixed $message message to log
string $priority priority of message (LOG, INFO, WARN, ERROR, GROUP_START, GROUP_END)
string $label optional label
Output
bool was successful?

line 507

isEnabled

public static void isEnabled ()

Unregister error handler routine.

Output
void  

line 596

processException

public static void processException ($exception, [bool $outputAllowed = FALSE])

Logs or displays exception.

Input
$exception
bool $outputAllowed is writing to standard output buffer allowed?
Output
void  

line 401

timer

public static elapsed timer ([string $name = NULL])

Starts/stops stopwatch.

Input
string $name name
Output
elapsed seconds