ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTraceProcessor Class Reference

Logging factory. More...

+ Collaboration diagram for ilTraceProcessor:

Public Member Functions

 __construct (int $a_level)
 
 __invoke (LogRecord $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 34 of file class.ilTraceProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilTraceProcessor::__construct ( int  $a_level)

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

39  {
40  $this->level = $a_level;
41  }

Member Function Documentation

◆ __invoke()

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

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

46  : LogRecord
47  {
48  if ($record['level'] < $this->level) {
49  return $record;
50  }
51 
52  $trace = debug_backtrace();
53 
54  // shift current method
55  array_shift($trace);
56 
57  // shift internal monolog calls
58  array_shift($trace);
59  array_shift($trace);
60  array_shift($trace);
61  array_shift($trace);
62 
63  if (is_array($trace) && count($trace)) {
64  $trace_info =
65  ($trace[0]['class'] ?? '') . '::' .
66  ($trace[0]['function'] ?? '') . ':' .
67  ($trace[0]['line'] ?? '');
68  $record['extra'] = array_merge(
69  $record['extra'],
70  array('trace' => $trace_info)
71  );
72  }
73  return $record;
74  }

Field Documentation

◆ $level

int ilTraceProcessor::$level = 0
private

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


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