Class Debug (namespace Nette)


Debug static class.


Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /Debug.php (line 21)
Public Method Summary
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.
static void
toStringException ($exception)
Handles exception throwed in __toString().
Debug
Static class - cannot be instantiated.
Constant Summary
null DETECT NULL

line 57

server modes Debug::enable()
bool DEVELOPMENT FALSE

line 55

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

line 110

FirePHP log priority
string EXCEPTION 'EXCEPTION'

line 112

FirePHP log priority
string GROUP_END 'GROUP_END'

line 114

FirePHP log priority
string GROUP_START 'GROUP_START'

line 113

FirePHP log priority
string INFO 'INFO'

line 108

FirePHP log priority
string LOG 'LOG'

line 107

FirePHP log priority
bool PRODUCTION TRUE

line 56

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

line 111

FirePHP log priority
string WARN 'WARN'

line 109

FirePHP log priority
Variable Summary
static bool $consoleMode

line 27

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

line 102

free counters for your usage
static int $emailSnooze 172800

line 70

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

line 67

static int $maxDepth 3

line 44

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

line 47

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

line 64

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

line 24

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

line 50

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

line 61

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

line 30


Method Details

line 796

addColophon

public static void addColophon (callback $callback)

Add custom descriptions.

Input
callback $callback
Output
void  

line 262

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 780

disableProfiler

public static void disableProfiler ()

Disables profiler.

Output
void  

line 224

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 412

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, autodetection or IP address(es).
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 769

enableProfiler

public static void enableProfiler ()

Enables profiler.

Output
void  

line 870

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 885

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 504

isEnabled

public static void isEnabled ()

Unregister error handler routine.

Output
void  

line 588

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 390

timer

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

Starts/stops stopwatch.

Input
string $name name
Output
elapsed seconds

line 661

toStringException

public static void toStringException ($exception)

Handles exception throwed in __toString().

Input
$exception
Output
void  

line 122

__construct

public Debug __construct ()

Static class - cannot be instantiated.

Output
Debug