Class Debug (namespace Nette)


Debug static class.


Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Debug.php (line 38)
Constructor Summary
public
Static class - cannot be instantiated.
Method Summary
static void
addColophon (callback $callback)
Add custom descriptions.
static mixed
dump (mixed $var, [bool $return = FALSE])
Dumps information about a variable in readable format.
static void
enable ([int $level = NULL], [string $logFile = NULL], [array|string $email = NULL])
Enables displaying or logging errors and exceptions.
static void
Enables profiler.
static void
errorHandler (int $severity, string $message, string $file, int $line, array $context)
Own error handler.
static void
exceptionHandler ($exception)
Debug exception handler.
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
paintBlueScreen ($exception)
Paint blue screen.
static void
Paint profiler window.
static void
processException ($exception, [bool $outputAllowed = FALSE])
Logs or displays exception.
static void
sendEmail (string $message)
Sends e-mail notification.
static elapsed
timer ([string $name = NULL])
Starts/stops stopwatch.
static string
writeFile (string $buffer)
Redirects output to file.
Constant Summary
string ERROR 'ERROR'

line 107

FirePHP log priority
string INFO 'INFO'

line 105

FirePHP log priority
string LOG 'LOG'

line 104

FirePHP log priority
string WARN 'WARN'

line 106

FirePHP log priority
Variable Summary
static bool $consoleMode

line 50

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

line 41

free counters for your usage
static float $emailProbability 0.01

line 92

probability that logfile will be checked
static mixed $html

line 44

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

line 59

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

line 89

static int $maxDepth 3

line 53

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

line 56

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

line 47

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

line 101


Constructor Details

line 115

__construct

public __construct ()

Static class - cannot be instantiated.

Method Details

line 645

addColophon

public static void addColophon (callback $callback)

Add custom descriptions.

Input
callback $callback
Output
void  

line 147

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 294

enable

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

Enables displaying or logging errors and exceptions.

Input
int $level error reporting level
string $logFile error log file (enables production mode)
array|string $email administrator email or email headers; enables email sending
Output
void  

line 605

enableProfiler

public static void enableProfiler ()

Enables profiler.

Output
void  

line 425

errorHandler

public static void errorHandler (int $severity, string $message, string $file, int $line, array $context)

Own error handler.

Input
int $severity level of the error raised
string $message error message
string $file file that the error was raised in
int $line line number the error was raised at
array $context an array of variables that existed in the scope the error was triggered in
Output
void  
Throws
throws FatalErrorException

line 402

exceptionHandler

public static void exceptionHandler ($exception)

Debug exception handler.

Input
$exception
Output
void  

line 711

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 725

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 660

getDefaultColophons

public static array getDefaultColophons (string $sender)

Returns default colophons.

Input
string $sender profiler | bluescreen
Output
array  

line 125

init

public static void init ()

Static class constructor.

Output
void  

line 389

isEnabled

public static void isEnabled ()

Unregister error handler routine.

Output
void  

line 524

paintBlueScreen

public static void paintBlueScreen ($exception)

Paint blue screen.

Input
$exception
Output
void  

line 618

paintProfiler

public static void paintProfiler ()

Paint profiler window.

Output
void  

line 477

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 550

sendEmail

public static void sendEmail (string $message)

Sends e-mail notification.

Input
string $message
Output
void  

line 272

timer

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

Starts/stops stopwatch.

Input
string $name name
Output
elapsed seconds

line 538

writeFile

public static string writeFile (string $buffer)

Redirects output to file.

Input
string $buffer
Output
string