tag; $logFile = Factory::getLog()->getLogFilename($tag); if (!@is_file($logFile) && @file_exists(substr($logFile, 0, -4))) { /** * Transitional period: the log file akeeba.tag.log.php may not exist but the akeeba.tag.log does. This * addresses this transition. */ $logFile = substr($logFile, 0, -4); } @ob_end_clean(); if (!@file_exists($logFile)) { // Oops! The log doesn't exist! echo '

' . Text::_('COM_AKEEBABACKUP_LOG_ERROR_LOGFILENOTEXISTS') . '

'; return; } else { // Allright, let's load and render it $fp = fopen($logFile, "r"); if ($fp === FALSE) { // Oops! The log isn't readable?! echo '

' . Text::_('COM_AKEEBABACKUP_LOG_ERROR_UNREADABLE') . '

'; return; } while (!feof($fp)) { $line = fgets($fp); if (!$line) return; $exploded = explode("|", $line, 3); unset($line); if (count($exploded) < 3) continue; switch (trim($exploded[0])) { case "ERROR": $fmtString = "["; break; case "WARNING": $fmtString = "["; break; case "INFO": $fmtString = "["; break; case "DEBUG": $fmtString = "["; break; default: $fmtString = "["; break; } $fmtString .= $exploded[1] . "] " . htmlspecialchars($exploded[2]) . "
\n"; unset($exploded); echo $fmtString; unset($fmtString); } } @ob_start();