Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

Interfaces

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class NDebugger

Debugger: displays and logs errors.

Behavior is determined by two factors: mode & output

  • modes: production / development
  • output: HTML / AJAX / CLI / other (e.g. XML)
Package: Nette\Diagnostics
Author: David Grudl
Located at Diagnostics/Debugger.php
Methods summary
final public
# __construct( )

Static class - cannot be instantiated.

Static class - cannot be instantiated.

public static
# enable( mixed $mode = NULL, string $logDirectory = NULL, string $email = NULL )

Enables displaying or logging errors and exceptions.

Enables displaying or logging errors and exceptions.

Parameters

$mode
mixed
production, development mode, autodetection or IP address(es) whitelist.
$logDirectory
string
error log directory; enables logging in production mode, FALSE means that logging is disabled
$email
string
administrator email; enables email sending in production mode
public static boolean
# isEnabled( )

Is Debug enabled?

Is Debug enabled?

Returns

boolean
public static string
# log( string|Exception $message, integer $priority = NDebugger::INFO )

Logs message or exception to file (if not disabled) and sends email notification (if enabled).

Logs message or exception to file (if not disabled) and sends email notification (if enabled).

Parameters

$message
string|Exception
$priority
integer
one of constant NDebugger::INFO, WARNING, ERROR (sends email), CRITICAL (sends email)

Returns

string
logged error filename
public static
# toStringException( Exception $exception )

Handles exception thrown in __toString().

Handles exception thrown in __toString().

Parameters

$exception
Exception
public static
# tryError( )

Starts catching potential errors/warnings.

Starts catching potential errors/warnings.

public static boolean
# catchError( ErrorException & $error )

Returns catched error/warning message.

Returns catched error/warning message.

Parameters

$error
ErrorException
catched error

Returns

boolean
public static mixed
# dump( mixed $var, boolean $return = FALSE )

Dumps information about a variable in readable format.

Dumps information about a variable in readable format.

Parameters

$var
mixed
variable to dump
$return
boolean
return output instead of printing it? (bypasses $productionMode)

Returns

mixed
variable itself or dump
public static float
# timer( string $name = NULL )

Starts/stops stopwatch.

Starts/stops stopwatch.

Parameters

$name
string
name

Returns

float
elapsed seconds
public static mixed
# barDump( mixed $var, string $title = NULL )

Dumps information about a variable in Nette Debug Bar.

Dumps information about a variable in Nette Debug Bar.

Parameters

$var
mixed
variable to dump
$title
string
optional title

Returns

mixed
variable itself
public static boolean
# fireLog( mixed $message )

Sends message to FireLogger console.

Sends message to FireLogger console.

Parameters

$message
mixed
message to log

Returns

boolean
was successful?
public static
# addPanel( IBarPanel $panel, $id = NULL )

Deprecated

Constants summary
boolean DEVELOPMENT FALSE
#

server modes NDebugger::enable()

server modes NDebugger::enable()

boolean PRODUCTION TRUE
#

server modes NDebugger::enable()

server modes NDebugger::enable()

DETECT NULL
#

server modes NDebugger::enable()

server modes NDebugger::enable()

string DEBUG 'debug'
#

NDebugger::log() and NDebugger::fireLog()

NDebugger::log() and NDebugger::fireLog()

string INFO 'info'
#

NDebugger::log() and NDebugger::fireLog()

NDebugger::log() and NDebugger::fireLog()

string WARNING 'warning'
#

NDebugger::log() and NDebugger::fireLog()

NDebugger::log() and NDebugger::fireLog()

string ERROR 'error'
#

NDebugger::log() and NDebugger::fireLog()

NDebugger::log() and NDebugger::fireLog()

string CRITICAL 'critical'
#

NDebugger::log() and NDebugger::fireLog()

NDebugger::log() and NDebugger::fireLog()

Properties summary
public static boolean $productionMode
#

in production mode is suppressed any debugging output

in production mode is suppressed any debugging output

public static boolean $consoleMode
#

in console mode is omitted HTML output

in console mode is omitted HTML output

public static integer $time
#

timestamp with microseconds of the start of the request

timestamp with microseconds of the start of the request

public static string $source
#

requested URI or command line

requested URI or command line

public static string $editor 'editor://open/?file=%file&line=%line'
#

URL pattern mask to open editor

URL pattern mask to open editor

public static string $browser
#

command to open browser (use 'start ""' in Windows)

command to open browser (use 'start ""' in Windows)

public static integer $maxDepth 3
#

how many nested levels of array/object properties display NDebugger::dump()

how many nested levels of array/object properties display NDebugger::dump()

public static integer $maxLen 150
#

how long strings display NDebugger::dump()

how long strings display NDebugger::dump()

public static boolean $showLocation FALSE
#

display location? NDebugger::dump()

display location? NDebugger::dump()

public static array $consoleColors array( 'bool' => '1;33', 'null' => '1;33', 'int' => '1;36', 'float' => '1;36', 'string' => '1;32', 'array' => '1;31', 'key' => '1;37', 'object' => '1;31', 'visibility' => '1;30', 'resource' => '1;37', )
#
public static NDebugBlueScreen $blueScreen
#
public static boolean|integer $strictMode FALSE
#

determines whether any error will cause immediate death; if integer that it's matched against error severity

determines whether any error will cause immediate death; if integer that it's matched against error severity

public static boolean $scream FALSE
#

disables the @ (shut-up) operator so that notices and warnings are no longer hidden

disables the @ (shut-up) operator so that notices and warnings are no longer hidden

public static array $onFatalError array()
#

of callables specifies the functions that are automatically called after fatal error

of callables specifies the functions that are automatically called after fatal error

public static NLogger $logger
#
public static NFireLogger $fireLogger
#
public static string $logDirectory
#

name of the directory where errors should be logged; FALSE means that logging is disabled

name of the directory where errors should be logged; FALSE means that logging is disabled

public static string $email
#

email to sent error notifications

email to sent error notifications

public static $mailer
#

Deprecated

public static $emailSnooze
#

Deprecated

public static NDebugBar $bar
#
Nette Framework 2.0.18 (for PHP 5.2, prefixed) API documentation generated by ApiGen 2.8.0