/** * Logs the message * * @param \YapepBase\Log\Message\IMessage $message The message to log. * * @return void */ protected function logMessage(IMessage $message) { if ($message->getPriority() <= $this->minimumLogLevel) { $handle = fopen('php://stderr', 'a'); fwrite($handle, sprintf("%s %s(%d) [%s]: %s %s\n", date('d-M-Y H:i:s'), str_pad($this->logLevelHelper->getTextFromLevel($message->getPriority()), 5), $message->getPriority(), str_pad($message->getTag(), 20), $message->getMessage(), count($message->getFields()) > 0 ? sprintf('(DATA: "%s")', json_encode($message->getFields())) : '')); fclose($handle); } }
/** * Logs the message * * @param \YapepBase\Log\Message\IMessage $message The message to log. * * @return void */ protected function logMessage(IMessage $message) { $this->connection->log($message->getPriority(), $this->getLogMessage($message)); }