Class NDebug (namespace Nette)


NDebug static class.


Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /Debug.php (line 37)
Public Method Summary
NDebug
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 NDebug 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 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.
Constant Summary
null DETECT NULL

line 73

server modes NDebug::enable()
bool DEVELOPMENT FALSE

line 71

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

line 123

FirePHP log priority
string EXCEPTION 'EXCEPTION'

line 125

FirePHP log priority
string GROUP_END 'GROUP_END'

line 127

FirePHP log priority
string GROUP_START 'GROUP_START'

line 126

FirePHP log priority
string INFO 'INFO'

line 121

FirePHP log priority
string LOG 'LOG'

line 120

FirePHP log priority
bool PRODUCTION TRUE

line 72

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

line 124

FirePHP log priority
string WARN 'WARN'

line 122

FirePHP log priority
Variable Summary
static bool $consoleMode

line 43

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

line 115

free counters for your usage
static callback $mailer array(__CLASS__, 'defaultMailer')

line 83

static int $maxDepth 3

line 60

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

line 63

how long strings display NDebug::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? NDebug::dump()
static bool $strictMode FALSE

line 77

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

line 46


Method Details

line 135

__construct

public NDebug __construct ()

Static class - cannot be instantiated.

Output
NDebug  

line 768

addColophon

public static void addColophon (callback $callback)

Add custom descriptions.

Input
callback $callback
Output
void  

line 273

consoleDump

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

Dumps information about a variable in Nette NDebug Console.

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

line 752

disableProfiler

public static void disableProfiler ()

Disables profiler.

Output
void  

line 236

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 419

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 741

enableProfiler

public static void enableProfiler ()

Enables profiler.

Output
void  

line 843

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 858

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 788

getDefaultColophons

public static array getDefaultColophons (string $sender)

Returns default colophons.

Input
string $sender profiler | bluescreen
Output
array  

line 145

init

public static void init ()

Static class constructor.

Output
void  

line 503

isEnabled

public static void isEnabled ()

Unregister error handler routine.

Output
void  

line 592

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 397

timer

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

Starts/stops stopwatch.

Input
string $name name
Output
elapsed seconds