ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTraceProcessor Class Reference

Logging factory. More...

+ Collaboration diagram for ilTraceProcessor:

Public Member Functions

 __construct ($a_level)
 
 __invoke (array $record)
 

Private Attributes

 $level = 0
 

Detailed Description

Logging factory.

This class supplies an implementation for the locator. The locator will send its output to ist own frame, enabling more flexibility in the design of the desktop.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilTraceProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilTraceProcessor::__construct (   $a_level)

Definition at line 19 of file class.ilTraceProcessor.php.

20  {
21  $this->level = $a_level;
22  }

Member Function Documentation

◆ __invoke()

ilTraceProcessor::__invoke ( array  $record)
Parameters
array$record
Returns
array

Definition at line 29 of file class.ilTraceProcessor.php.

30  {
31  if ($record['level'] < $this->level) {
32  return $record;
33  }
34 
35  $trace = debug_backtrace();
36 
37  // shift current method
38  array_shift($trace);
39 
40  // shift internal monolog calls
41  array_shift($trace);
42  array_shift($trace);
43  array_shift($trace);
44  array_shift($trace);
45 
46  $trace_info = $trace[0]['class'] . '::' . $trace[0]['function'] . ':' . $trace[0]['line'];
47 
48  $record['extra'] = array_merge(
49  $record['extra'],
50  array('trace' => $trace_info)
51  );
52  return $record;
53  }

Field Documentation

◆ $level

ilTraceProcessor::$level = 0
private

Definition at line 17 of file class.ilTraceProcessor.php.


The documentation for this class was generated from the following file: