File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,18 @@ protected function write($record): void
4646 $ stacktrace ->includeStacktraces ();
4747 $ stacktrace = $ stacktrace ->format ($ record );
4848 }
49+
50+ $ logLevelPsr = false ;
51+ $ logLevelName = '' ;
52+
53+ if (isset ($ record ->level )) {
54+ $ logLevelPsr = $ record ->level ->toPsrLogLevel ();
55+ $ logLevelName = $ record ->level ->getName ();
56+ }
57+
4958
5059 // Add emoji based on the error level
51- switch ($ record -> level -> toPsrLogLevel () ) {
60+ switch ($ logLevelPsr ) {
5261 case LogLevel::NOTICE :
5362 $ emoji = ':helicopter: ' ;
5463 break ;
@@ -104,7 +113,7 @@ protected function write($record): void
104113
105114 // Set embeds
106115 $ log ['embeds ' ][] = [
107- 'title ' => '**[ ' . now ()->format ('d.m.Y H:i:s ' ) . ']** ' .str ($ record -> level -> getName () )->lower ()->ucfirst ().' ' . $ emoji .' ' .$ this ->suffix ,
116+ 'title ' => '**[ ' . now ()->format ('d.m.Y H:i:s ' ) . ']** ' .str ($ logLevelName )->lower ()->ucfirst ().' ' . $ emoji .' ' .$ this ->suffix ,
108117 'description ' => "```css \n" . str ($ message )->limit ('4000 ' ) . '``` ' ,
109118 'color ' => 0xE74C3C ,
110119 'fields ' => $ fields
You can’t perform that action at this time.
0 commit comments