2 namespace TYPO3\CMS\Core\Log;
73 $this->minimumLogLevel = $level;
104 public function addWriter($minimumLevel, Writer\WriterInterface $writer)
109 for ($logLevelWhichTriggersWriter =
LogLevel::EMERGENCY; $logLevelWhichTriggersWriter <= $minimumLevel; $logLevelWhichTriggersWriter++) {
110 if (!isset($this->writers[$logLevelWhichTriggersWriter])) {
111 $this->writers[$logLevelWhichTriggersWriter] = array();
113 $this->writers[$logLevelWhichTriggersWriter][] = $writer;
138 public function addProcessor($minimumLevel, Processor\ProcessorInterface $processor)
143 for ($logLevelWhichTriggersProcessor =
LogLevel::EMERGENCY; $logLevelWhichTriggersProcessor <= $minimumLevel; $logLevelWhichTriggersProcessor++) {
144 if (!isset($this->processors[$logLevelWhichTriggersProcessor])) {
145 $this->processors[$logLevelWhichTriggersProcessor] = array();
147 $this->processors[$logLevelWhichTriggersProcessor][] = $processor;
172 public function log($level, $message, array $data = array())
176 if ($level > $this->minimumLogLevel) {
180 $record = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(LogRecord::class, $this->name, $level, $message, $data);
195 if (!empty($this->processors[$record->
getLevel()])) {
196 foreach ($this->processors[$record->
getLevel()] as $processor) {
197 $processedRecord = $processor->processLogRecord($record);
198 if (!$processedRecord instanceof
LogRecord) {
199 throw new \RuntimeException(
'Processor ' . get_class($processor) .
' returned invalid data. Instance of TYPO3\\CMS\\Core\\Log\\LogRecord expected', 1343593398);
201 $record = $processedRecord;
215 if (!empty($this->writers[$record->
getLevel()])) {
216 foreach ($this->writers[$record->
getLevel()] as $writer) {
217 $writer->writeLog($record);
229 public function emergency($message, array $data = array())
241 public function alert($message, array $data = array())
253 public function critical($message, array $data = array())
265 public function error($message, array $data = array())
277 public function warning($message, array $data = array())
289 public function notice($message, array $data = array())
301 public function info($message, array $data = array())
313 public function debug($message, array $data = array())