class Debug (View source)

The Debug class holds all methods to help debugging while development.

The output of all the contained methods can be activated/deactivated with defining the AM_DEBUG_ENABLED constant. All logged information will be stored in $buffer as JS's console.log() items.

Methods

static string
consoleLog()

Stop timer, calculate execution time, get user & server constants and return a console log item for every item in the buffer array.

static 
errorReporting()

Enable full error reporting, when debugging is enabled.

static array
getLog()

Return the buffer array.

static 
log(mixed $element, string $description = '')

Log any kind of variable and append it to the $buffer array.

Details

static string consoleLog()

Stop timer, calculate execution time, get user & server constants and return a console log item for every item in the buffer array.

Return Value

string The Javascript console log

static errorReporting()

Enable full error reporting, when debugging is enabled.

static array getLog()

Return the buffer array.

Return Value

array The log buffer array

static log(mixed $element, string $description = '')

Log any kind of variable and append it to the $buffer array.

Parameters

mixed $element (The actual content to log)
string $description (Basic info, class, method etc.)