Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/utility/logger.php
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Line(s) | |||||
* Caches state of debug mode | * Caches state of debug mode | ||||
* | * | ||||
* @var bool | * @var bool | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected $_debugMode = false; | protected $_debugMode = false; | ||||
/** | /** | ||||
* Ignores backtrace record where following files are mentioned | * Ignores backtrace record where following classes/files are mentioned | ||||
* | * | ||||
* @var Array | * @var array | ||||
* @access protected | |||||
*/ | */ | ||||
protected $_ignoreInTrace = Array ('logger.php', 'db_connection.php', 'db_load_balancer.php'); | protected $_ignoreInTrace = array( | ||||
'kLogger' => 'logger.php', | |||||
'kErrorHandlerStack' => 'logger.php', | |||||
'kExceptionHandlerStack' => 'logger.php', | |||||
'kDBConnection' => 'db_connection.php', | |||||
'kDBConnectionDebug' => 'db_connection.php', | |||||
'kDBLoadBalancer' => 'db_load_balancer.php', | |||||
); | |||||
/** | /** | ||||
* Create event log | * Create event log | ||||
* | * | ||||
* @param Array $methods_to_call List of invokable kLogger class method with their parameters (if any) | * @param Array $methods_to_call List of invokable kLogger class method with their parameters (if any) | ||||
* @access public | * @access public | ||||
*/ | */ | ||||
public function __construct($methods_to_call = Array ()) | public function __construct($methods_to_call = Array ()) | ||||
▲ Show 20 Lines • Show All 361 Lines • ▼ Show 20 Line(s) | |||||
if ( isset($levels) && is_numeric($levels) ) { | if ( isset($levels) && is_numeric($levels) ) { | ||||
for ($i = 0; $i < $levels; $i++) { | for ($i = 0; $i < $levels; $i++) { | ||||
array_shift($trace); | array_shift($trace); | ||||
} | } | ||||
} | } | ||||
if ( isset($files) && is_array($files) ) { | if ( isset($files) && is_array($files) ) { | ||||
$classes = array_keys($files); | |||||
while (true) { | while ( true ) { | ||||
$trace_info = $trace[0]; | $trace_info = $trace[0]; | ||||
$file = isset($trace_info['file']) ? basename($trace_info['file']) : ''; | $file = isset($trace_info['file']) ? basename($trace_info['file']) : ''; | ||||
$class = isset($trace_info['class']) ? $trace_info['class'] : ''; | |||||
if ( !in_array($file, $files) ) { | if ( ($file && !in_array($file, $files)) || ($class && !in_array($class, $classes)) ) { | ||||
break; | break; | ||||
} | } | ||||
array_shift($trace); | array_shift($trace); | ||||
} | } | ||||
} | } | ||||
return $trace; | return $trace; | ||||
▲ Show 20 Lines • Show All 808 Lines • Show Last 20 Lines |