/** * List the log files. * * @return string[] */ public function logs() { $logs = array_reverse($this->filesystem->files()); foreach ($logs as $index => $file) { $logs[$index] = preg_replace('/.*(\\d{4}-\\d{2}-\\d{2}).*/', '$1', basename($file)); } return $logs; }
/** * Get the log instance. * * @param string $date * @param string $level * * @return \GrahamCampbell\LogViewer\Log\Log */ public function make($date, $level = 'all') { $raw = $this->filesystem->read($date); $levels = $this->levels; return new Log($raw, $levels, $level); }