/**
  * @return array
  */
 public static function all()
 {
     $log = array();
     $log_levels = self::getLogLevels();
     $pattern = '/\\[\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\].*/';
     if (!self::$file) {
         $log_file = self::getFiles();
         if (!count($log_file)) {
             return [];
         }
         self::$file = $log_file[0];
     }
     if (File::size(self::$file) > self::MAX_FILE_SIZE) {
         return null;
     }
     $file = File::get(self::$file);
     preg_match_all($pattern, $file, $headings);
     if (!is_array($headings)) {
         return $log;
     }
     $log_data = preg_split($pattern, $file);
     if ($log_data[0] < 1) {
         array_shift($log_data);
     }
     foreach ($headings as $h) {
         for ($i = 0, $j = count($h); $i < $j; $i++) {
             foreach ($log_levels as $level_key => $level_value) {
                 if (strpos(strtolower($h[$i]), '.' . $level_value)) {
                     preg_match('/^\\[(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2})\\].*?\\.' . $level_key . ': (.*?)( in .*?:[0-9]+)?$/', $h[$i], $current);
                     if (!isset($current[2])) {
                         continue;
                     }
                     $log[] = array('level' => $level_value, 'level_class' => self::$levels_classes[$level_value], 'level_img' => self::$levels_imgs[$level_value], 'date' => $current[1], 'text' => $current[2], 'in_file' => isset($current[3]) ? $current[3] : null, 'stack' => preg_replace("/^\n*/", '', $log_data[$i]));
                 }
             }
         }
     }
     return array_reverse($log);
 }
 private static function getIgnoredFileNames()
 {
     if (!is_array(self::$ignoredFileNames)) {
         self::$ignoredFileNames = config('logviewer.ignore');
     }
     return self::$ignoredFileNames;
 }