@@ -55,7 +55,7 @@ public function formatBatch(array $records): array
55
55
private function generateSignature (LogRecord $ record , ?Throwable $ exception ): string
56
56
{
57
57
if (! $ exception ) {
58
- return md5 ($ record ->message . json_encode ($ record ->context ));
58
+ return md5 ($ record ->message . json_encode ($ record ->context ));
59
59
}
60
60
61
61
$ trace = $ exception ->getTrace ();
@@ -65,7 +65,7 @@ private function generateSignature(LogRecord $record, ?Throwable $exception): st
65
65
$ exception ::class,
66
66
$ exception ->getFile (),
67
67
$ exception ->getLine (),
68
- $ firstFrame ? ($ firstFrame ['file ' ] ?? '' ) . ': ' . ($ firstFrame ['line ' ] ?? '' ) : '' ,
68
+ $ firstFrame ? ($ firstFrame ['file ' ] ?? '' ). ': ' . ($ firstFrame ['line ' ] ?? '' ) : '' ,
69
69
]));
70
70
}
71
71
@@ -111,7 +111,7 @@ private function formatTitle(LogRecord $record, ?Throwable $exception = null): s
111
111
private function formatContent (LogRecord $ record , ?Throwable $ exception ): string
112
112
{
113
113
return Str::of ('' )
114
- ->when ($ record ->message , fn ($ str , $ message ) => $ str ->append ("**Message:** \n{$ message }\n\n" ))
114
+ ->when ($ record ->message , fn ($ str , $ message ) => $ str ->append ("**Message:** \n{$ message }\n\n" ))
115
115
->when (
116
116
$ exception ,
117
117
function (Stringable $ str , Throwable $ exception ) {
@@ -121,8 +121,8 @@ function (Stringable $str, Throwable $exception) {
121
121
);
122
122
}
123
123
)
124
- ->when (! empty ($ record ->context ), fn ($ str , $ context ) => $ str ->append ("**Context:** \n```json \n" . json_encode (Arr::except ($ record ->context , ['exception ' ]), JSON_PRETTY_PRINT ) . "\n``` \n\n" ))
125
- ->when (! empty ($ record ->extra ), fn ($ str , $ extra ) => $ str ->append ("**Extra Data:** \n```json \n" . json_encode ($ record ->extra , JSON_PRETTY_PRINT ) . "\n``` \n" ))
124
+ ->when (! empty ($ record ->context ), fn ($ str , $ context ) => $ str ->append ("**Context:** \n```json \n" . json_encode (Arr::except ($ record ->context , ['exception ' ]), JSON_PRETTY_PRINT ). "\n``` \n\n" ))
125
+ ->when (! empty ($ record ->extra ), fn ($ str , $ extra ) => $ str ->append ("**Extra Data:** \n```json \n" . json_encode ($ record ->extra , JSON_PRETTY_PRINT ). "\n``` \n" ))
126
126
->toString ();
127
127
}
128
128
@@ -142,7 +142,7 @@ private function formatBody(LogRecord $record, string $signature, ?Throwable $ex
142
142
private function cleanStackTrace (string $ stackTrace ): string
143
143
{
144
144
return collect (explode ("\n" , $ stackTrace ))
145
- ->filter (fn ($ line ) => ! empty (trim ($ line )))
145
+ ->filter (fn ($ line ) => ! empty (trim ($ line )))
146
146
->map (function ($ line ) {
147
147
if (trim ($ line ) === '"} ' ) {
148
148
return '' ;
@@ -218,8 +218,8 @@ private function formatExceptionDetails(Throwable $exception): array
218
218
219
219
return [
220
220
'message ' => $ exception ->getMessage (),
221
- 'stack_trace ' => $ header . "\n[stacktrace] \n" . $ this ->cleanStackTrace ($ exception ->getTraceAsString ()),
222
- 'full_stack_trace ' => $ header . "\n[stacktrace] \n" . $ exception ->getTraceAsString (),
221
+ 'stack_trace ' => $ header. "\n[stacktrace] \n" . $ this ->cleanStackTrace ($ exception ->getTraceAsString ()),
222
+ 'full_stack_trace ' => $ header. "\n[stacktrace] \n" . $ exception ->getTraceAsString (),
223
223
];
224
224
}
225
225
0 commit comments