Class Debug (namespace Nette)


Debug static class.


Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Debug.php (line 38)
Public Method Summary
static void
addColophon (callback $callback)
Add custom descriptions.
static void
Disables profiler.
static mixed
dump (mixed $var, [bool $return = FALSE])
Dumps information about a variable in readable format.
static void
enable ([bool $productionMode = NULL], [string $logFile = NULL], [array|string $email = NULL])
Enables displaying or logging errors and exceptions.
static void
Enables profiler.
static bool
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 array
getDefaultColophons (string $sender)
Returns default colophons.
static void
init ()
Static class constructor.
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.
Debug
Static class - cannot be instantiated.
Constant Summary
null DETECT NULL

line 43

server modes Debug::enable()
bool DEVELOPMENT FALSE

line 41

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

line 116

FirePHP log priority
string EXCEPTION 'EXCEPTION'

line 118

FirePHP log priority
string GROUP_END 'GROUP_END'

line 120

FirePHP log priority
string GROUP_START 'GROUP_START'

line 119

FirePHP log priority
string INFO 'INFO'

line 114

FirePHP log priority
string LOG 'LOG'

line 113

FirePHP log priority
bool PRODUCTION TRUE

line 42

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

line 117

FirePHP log priority
string WARN 'WARN'

line 115

FirePHP log priority
Variable Summary
static bool $consoleMode

line 56

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

line 47

free counters for your usage
static mixed $emailProbability

line 101

static mixed $html

line 50

static int $keysToHide array('password', 'passwd', 'pass', 'pwd', 'creditcard', 'credit card', 'cc', 'pin')

line 65

sensitive keys not displayed by Debug::dump() when Debug::$productionMode in on
static callback $mailer array(__CLASS__, 'defaultMailer')

line 98

static int $maxDepth 3

line 59

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

line 62

how long strings display Debug::dump()
static bool $productionMode

line 53

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

line 110


Method Details

line 709

addColophon

public static void addColophon (callback $callback)

Add custom descriptions.

Input
callback $callback
Output
void  

line 665

disableProfiler

public static void disableProfiler ()

Disables profiler.

Output
void  

line 160

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 or dump

line 307

enable

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

Enables displaying or logging errors and exceptions.

Input
bool $productionMode enable production mode? (NULL means 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 653

enableProfiler

public static void enableProfiler ()

Enables profiler.

Output
void  

line 784

fireDump

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

Sends variable dump to Firebug tab request/server.

Input
mixed $var variable to dump
string $key unique key
Output
bool was successful?

line 798

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 729

getDefaultColophons

public static array getDefaultColophons (string $sender)

Returns default colophons.

Input
string $sender profiler | bluescreen
Output
array  

line 138

init

public static void init ()

Static class constructor.

Output
void  

line 400

isEnabled

public static void isEnabled ()

Unregister error handler routine.

Output
void  

line 518

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 285

timer

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

Starts/stops stopwatch.

Input
string $name name
Output
elapsed seconds

line 128

__construct

public Debug __construct ()

Static class - cannot be instantiated.

Output
Debug