private function _getLogReport($level = null) { $filePath = $this->_logDir . "/{$this->_year}/{$this->_month}/{$this->_day}.php"; if (file_exists($filePath)) { $Report = new Model_Logreport($filePath); $logsEntries = $Report->getLogsEntries(); if ($level) { foreach ($logsEntries as $k => $entry) { if (Arr::get($entry, 'level') != $level) { unset($logsEntries[$k]); } } } $title = "Log Report - {$this->_year}/{$this->_month}/{$this->_day}"; $title .= ' <small>' . ($this->_level ? " {$this->_level}" : ' All') . ' Logs</small>'; return View::factory('logs/report', array('logs' => $logsEntries, 'header' => $title)); //return $this->_createMessage("<b>File found!</b> Beautiful report coming soon.", 'success'); } else { return $this->_createMessage("<b>No log file found for {$this->_year}/{$this->_month}/{$this->_day}!</b> Please select a Log file from left sidebar.", 'warning'); } }
private function _getLogReport($level = null) { $filePath = $this->_config['log_path'] . "/{$this->_year}/{$this->_month}/{$this->_day}.php"; if (file_exists($filePath)) { $Report = new Model_Logreport($filePath); $logsEntries = $Report->getLogsEntries(); if ($level) { $intlevel = array_search($level, Model_Logreport::$levels); foreach ($logsEntries as $k => $entry) { if (array_search(Arr::get($entry, 'level'), Model_Logreport::$levels) > $intlevel) { unset($logsEntries[$k]); } } } $title = sprintf(__('Log Report - %04d/%02d/%02d <small>%s logs</small>'), $this->_year, $this->_month, $this->_day, $this->_level ? $this->_level : __('All')); return View::factory('logs/report', array('logs' => $logsEntries, 'header' => $title)); //return $this->_createMessage("<b>File found!</b> Beautiful report coming soon.", 'success'); } else { return $this->_createMessage(sprintf(__('<b>No log file found for %04d/%02d/%02d!</b> Please select a Log file from left sidebar.'), $this->_year, $this->_month, $this->_day), 'warning'); } }