Skip to content

Commit 119f566

Browse files
committed
work with logs that dont have the level structure
1 parent 71638eb commit 119f566

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/app/Classes/LogViewer.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,25 @@ public static function all()
179179
}
180180
}
181181

182+
if (empty($log)) {
183+
$lines = preg_split('/\r\n|\r|\n/', $file);
184+
185+
foreach ($lines as $line) {
186+
if (!empty(trim($line))) {
187+
$log[] = [
188+
'context' => null,
189+
'level' => 'info',
190+
'level_class' => static::$levels_classes['info'],
191+
'level_img' => static::$levels_imgs['info'],
192+
'date' => null,
193+
'text' => $line,
194+
'in_file' => null,
195+
'stack' => '',
196+
];
197+
}
198+
}
199+
}
200+
182201
return array_reverse($log);
183202
}
184203

0 commit comments

Comments
 (0)