Example #1
0
 public function getLogClass(LogItem $log)
 {
     $logType = LogHelper::getInstance()->convertToLogType($log->getLogLevel());
     if ($logType == LogHelper::LOG_TYPE_USER_ERROR) {
         return "warning-message";
     }
     if ($logType == LogHelper::LOG_TYPE_USER_INFO) {
         return "info-message";
     }
     if ($logType == LogHelper::LOG_TYPE_SYSTEM_ERROR) {
         return "danger-message";
     }
     LogHelper::getInstance()->logError("Unknown logtype", $log);
     return "";
 }
Example #2
0
 public function renderLogItemAsHtml(LogItem $log, $shortenUserMessages = true)
 {
     if (($log->getLogLevel() == LogHelper::LOG_USER_INFO || $log->getLogLevel() == LogHelper::LOG_USER_ERROR) && $shortenUserMessages) {
         return nl2br("<b>" . $this->getLogLevelAsString($log->getLogLevel()) . "</b>: " . $log->getMessage());
     }
     return nl2br("<b>" . $this->getLogLevelAsString($log->getLogLevel()) . "</b>: " . $log->getMessage() . "<br/>" . $log->getSource());
 }