TYPO3 CMS  TYPO3_6-2
IntrospectionProcessor.php
Go to the documentation of this file.
1 <?php
3 
18 
25 
34  public function processLogRecord(LogRecord $logRecord) {
35  $trace = debug_backtrace();
36  // skip first since it's always the current method
37  array_shift($trace);
38  // the call_user_func call is also skipped
39  array_shift($trace);
40  // skip TYPO3\CMS\Core\Log classes
41  // @TODO: Check, if this still works. This was 't3lib_log_' before namespace switch.
42  $i = 0;
43  while (isset($trace[$i]['class']) && FALSE !== strpos($trace[$i]['class'], 'TYPO3\CMS\Core\Log')) {
44  $i++;
45  }
46  // we should have the call source now
47  $logRecord->addData(array(
48  'file' => isset($trace[$i]['file']) ? $trace[$i]['file'] : NULL,
49  'line' => isset($trace[$i]['line']) ? $trace[$i]['line'] : NULL,
50  'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : NULL,
51  'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : NULL
52  ));
53  return $logRecord;
54  }
55 
56 }