class Debugger

Debugger: displays and logs errors.

Constants

VERSION

DEVELOPMENT

server modes for Debugger::enable()

PRODUCTION

server modes for Debugger::enable()

DETECT

server modes for Debugger::enable()

COOKIE_SECRET

DEBUG

for Debugger::log() and Debugger::fireLog()

INFO

for Debugger::log() and Debugger::fireLog()

WARNING

for Debugger::log() and Debugger::fireLog()

ERROR

for Debugger::log() and Debugger::fireLog()

EXCEPTION

for Debugger::log() and Debugger::fireLog()

CRITICAL

for Debugger::log() and Debugger::fireLog()

Properties

static bool $productionMode
static bool $showBar
static bool $showFireLogger
static bool|int $strictMode
static bool $scream
static callable[] $onFatalError
static int $maxDepth
static int $maxLength
static bool $showLocation
static $maxLen
static string|null $logDirectory
static int $logSeverity
static string|array $email
static int $time
static string $editor
static array $editorMapping
static string $browser
static string $errorTemplate
static string[] $customCssFiles
static string[] $customJsFiles

Methods

__construct()

Static class - cannot be instantiated.

static void
enable(mixed $mode = null, string $logDirectory = null, string|array $email = null)

Enables displaying or logging errors and exceptions.

static void
dispatch()

No description

static void
renderLoader()

Renders loading

<

script>

static bool
isEnabled()

No description

static void
shutdownHandler()

Shutdown handler to catch fatal errors and execute of the planned activities.

static void
exceptionHandler(Throwable $exception, bool $exit = true)

Handler to catch uncaught exception.

static bool|null
errorHandler(int $severity, string $message, string $file, int $line, array $context = [])

Handler to catch warnings and notices.

static BlueScreen
getBlueScreen()

No description

static Bar
getBar()

No description

static void
setLogger(ILogger $logger)

No description

static ILogger
getLogger()

No description

static ILogger
getFireLogger()

No description

static mixed
dump(mixed $var, bool $return = false)

Dumps information about a variable in readable format.

static float
timer(string $name = null)

Starts/stops stopwatch.

static mixed
barDump($var, string $title = null, array $options = [])

Dumps information about a variable in Tracy Debug Bar.

static mixed
log($message, string $priority = ILogger::INFO)

Logs message or exception.

static bool
fireLog(mixed $message)

Sends message to FireLogger console.

static bool
detectDebugMode(string|array $list = null)

Detects debug mode by IP address.

Details

at line 137
final __construct()

Static class - cannot be instantiated.

at line 149
static void enable(mixed $mode = null, string $logDirectory = null, string|array $email = null)

Enables displaying or logging errors and exceptions.

Parameters

mixed $mode production, development mode, autodetection or IP address(es) whitelist.
string $logDirectory error log directory
string|array $email administrator email; enables email sending in production mode

Return Value

void

at line 207
static void dispatch()

Return Value

void

at line 236
static void renderLoader()

Renders loading

<

script>

Return Value

void

at line 244
static bool isEnabled()

Return Value

bool

at line 254
static void shutdownHandler()

Shutdown handler to catch fatal errors and execute of the planned activities.

Return Value

void

at line 284
static void exceptionHandler(Throwable $exception, bool $exit = true)

Handler to catch uncaught exception.

Parameters

Throwable $exception
bool $exit

Return Value

void

at line 361
static bool|null errorHandler(int $severity, string $message, string $file, int $line, array $context = [])

Handler to catch warnings and notices.

Parameters

int $severity
string $message
string $file
int $line
array $context

Return Value

bool|null false to call normal error handler, null otherwise

Exceptions

ErrorException

at line 441
static BlueScreen getBlueScreen()

Return Value

BlueScreen

at line 455
static Bar getBar()

Return Value

Bar

at line 467
static void setLogger(ILogger $logger)

Parameters

ILogger $logger

Return Value

void

at line 473
static ILogger getLogger()

Return Value

ILogger

at line 484
static ILogger getFireLogger()

Return Value

ILogger

at line 503
static mixed dump(mixed $var, bool $return = false)

Dumps information about a variable in readable format.

Parameters

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

Return Value

mixed variable itself or dump

at line 529
static float timer(string $name = null)

Starts/stops stopwatch.

Parameters

string $name

Return Value

float elapsed seconds

at line 545
static mixed barDump($var, string $title = null, array $options = [])

Dumps information about a variable in Tracy Debug Bar.

Parameters

$var
string $title
array $options

Return Value

mixed variable itself

at line 568
static mixed log($message, string $priority = ILogger::INFO)

Logs message or exception.

Parameters

$message
string $priority

Return Value

mixed

at line 578
static bool fireLog(mixed $message)

Sends message to FireLogger console.

Parameters

mixed $message

Return Value

bool

at line 590
static bool detectDebugMode(string|array $list = null)

Detects debug mode by IP address.

Parameters

string|array $list IP addresses or computer names whitelist detection

Return Value

bool