This is a debugger class.

Helps in debugging your code. It lets you decide which messages are logged into the logfile by setting loglevels for the debugger and for each message.

There are five loglevel constants you can use when setting the loglevel or when logging messages:

  • MIDCOM_LOG_DEBUG
  • MIDCOM_LOG_INFO
  • MIDCOM_LOG_WARN
  • MIDCOM_LOG_ERROR
  • MIDCOM_LOG_CRIT

This file declares shortcuts like debug_add (see below).

package midcom

 Methods

__construct ($filename)

Standard constructor

Parameters

$filename

disable ()

Disable the Debugger

enable ()

Enable the Debugger

get_loglevel ()

Get log level

is_enabled ()

Is the debugger enabled?

Returns

booleanDebugger state

log (string $message, int $loglevel)

Log a message

Parameters

$message

stringThe message to be logged

$loglevel

intThe log level

print_dump_mem (string $message, int $loglevel)

Dump the current memory usage and the delta to the last call of this function.

Useful for tracking memory leaks.

Format will be:

$curmem (delta $delta): $message

Parameters

$message

stringThe message to be logged

$loglevel

intThe log level

print_function_stack (string $message, int $loglevel)

Dump stack trace, only working when XDebug is present.
link xdebug.org

Parameters

$message

stringThe message to be logged

$loglevel

intThe log level

print_r (string $message, mixed $variable, int $loglevel)

Dump a variable (by reference)

Parameters

$message

stringThe message to be logged

$variable

mixed&$variable The variable to be logged

$loglevel

intThe log level

print_type (string $message, mixed $variable, int $loglevel)

Dump a variables type (by reference)

Parameters

$message

stringThe message to be logged

$variable

mixed&$variable The variable of which the type should be logged

$loglevel

intThe log level

set_loglevel (int $loglevel)

Set log level

Parameters

$loglevel

intNew log level

_get_caller ($bt)

Parameters

$bt

 Properties

 

\FirePHP $firephp

Access to installed FirePHP logger
 

boolean $_enabled

Flag which is true if the debugger is enabled.
 

string $_filename

Logfile name
 

int $_loglevel

Current loglevel
 

array $_loglevels

All available loglevels