diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php index 93e6f50..43d7b30 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php @@ -29,6 +29,25 @@ public static function all() unset($trash); } + $levels_classes = [ + 'debug' => 'info', + 'info' => 'info', + 'notice' => 'info', + 'warning' => 'warning', + 'error' => 'danger', + 'critical' => 'danger', + 'alert' => 'danger', + ]; + $levels_imgs = [ + 'debug' => 'info', + 'info' => 'info', + 'notice' => 'info', + 'warning' => 'warning', + 'error' => 'warning', + 'critical' => 'warning', + 'alert' => 'warning', + ]; + foreach ($headings as $h) { for ($i=0, $j = count($h); $i < $j; $i++) { foreach ($log_levels as $ll) { @@ -38,8 +57,11 @@ public static function all() preg_match('/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\].*?\.' . $level . ': (.*?)( in .*?:[0-9]+)?$/', $h[$i], $current); + $log[] = array( 'level' => $ll, + 'level_class' => $levels_classes[$ll], + 'level_img' => $levels_imgs[$ll], 'date' => $current[1], 'text' => $current[2], 'in_file' => isset($current[3]) ? $current[3] : null, diff --git a/src/views/log.blade.php b/src/views/log.blade.php index f203224..db3d040 100644 --- a/src/views/log.blade.php +++ b/src/views/log.blade.php @@ -8,6 +8,9 @@ + + + @@ -15,46 +18,60 @@ +
-Level | -Date | -Content | -
---|---|---|
{{{$log['level']}}} | -{{{$log['date']}}} | -
- {{{$log['text']}}}
- @if (isset($log['in_file']))
- {{{$log['in_file']}}} - @endif - |
-
Level | +Date | +Content | +
---|---|---|
{{$log['level']}} | +{{{$log['date']}}} | +
+ {{{$log['text']}}}
+ @if (isset($log['in_file']))
+ {{{$log['in_file']}}} + @endif + |
+