ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTraceProcessor Class Reference

Logging factory. More...

+ Collaboration diagram for ilTraceProcessor:

Public Member Functions

 __construct (int $a_level)
 
 __invoke (array $record)
 

Private Attributes

int $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 17 of file class.ilTraceProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilTraceProcessor::__construct ( int  $a_level)

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

22  {
23  $this->level = $a_level;
24  }

Member Function Documentation

◆ __invoke()

ilTraceProcessor::__invoke ( array  $record)
Todo:
fix shifting calls

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

29  : array
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  if (is_array($trace) && count($trace)) {
47  $trace_info =
48  ($trace[0]['class'] ?? '') . '::' .
49  ($trace[0]['function'] ?? '') . ':' .
50  ($trace[0]['line'] ?? '');
51  $record['extra'] = array_merge(
52  $record['extra'],
53  array('trace' => $trace_info)
54  );
55  }
56  return $record;
57  }

Field Documentation

◆ $level

int ilTraceProcessor::$level = 0
private

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


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