Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray authored and github-actions[bot] committed Jan 12, 2025
1 parent c8d9d91 commit a352130
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Formatters/GithubIssueFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function formatBatch(array $records): array
private function generateSignature(LogRecord $record, ?Throwable $exception): string
{
if (! $exception) {
return md5($record->message . json_encode($record->context));
return md5($record->message.json_encode($record->context));
}

$trace = $exception->getTrace();
Expand All @@ -65,7 +65,7 @@ private function generateSignature(LogRecord $record, ?Throwable $exception): st
$exception::class,
$exception->getFile(),
$exception->getLine(),
$firstFrame ? ($firstFrame['file'] ?? '') . ':' . ($firstFrame['line'] ?? '') : '',
$firstFrame ? ($firstFrame['file'] ?? '').':'.($firstFrame['line'] ?? '') : '',
]));
}

Expand Down Expand Up @@ -111,7 +111,7 @@ private function formatTitle(LogRecord $record, ?Throwable $exception = null): s
private function formatContent(LogRecord $record, ?Throwable $exception): string
{
return Str::of('')
->when($record->message, fn($str, $message) => $str->append("**Message:**\n{$message}\n\n"))
->when($record->message, fn ($str, $message) => $str->append("**Message:**\n{$message}\n\n"))
->when(
$exception,
function (Stringable $str, Throwable $exception) {
Expand All @@ -121,8 +121,8 @@ function (Stringable $str, Throwable $exception) {
);
}
)
->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"))
->when(! empty($record->extra), fn($str, $extra) => $str->append("**Extra Data:**\n```json\n" . json_encode($record->extra, JSON_PRETTY_PRINT) . "\n```\n"))
->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"))
->when(! empty($record->extra), fn ($str, $extra) => $str->append("**Extra Data:**\n```json\n".json_encode($record->extra, JSON_PRETTY_PRINT)."\n```\n"))
->toString();
}

Expand All @@ -142,7 +142,7 @@ private function formatBody(LogRecord $record, string $signature, ?Throwable $ex
private function cleanStackTrace(string $stackTrace): string
{
return collect(explode("\n", $stackTrace))
->filter(fn($line) => ! empty(trim($line)))
->filter(fn ($line) => ! empty(trim($line)))
->map(function ($line) {
if (trim($line) === '"}') {
return '';
Expand Down Expand Up @@ -218,8 +218,8 @@ private function formatExceptionDetails(Throwable $exception): array

return [
'message' => $exception->getMessage(),
'stack_trace' => $header . "\n[stacktrace]\n" . $this->cleanStackTrace($exception->getTraceAsString()),
'full_stack_trace' => $header . "\n[stacktrace]\n" . $exception->getTraceAsString(),
'stack_trace' => $header."\n[stacktrace]\n".$this->cleanStackTrace($exception->getTraceAsString()),
'full_stack_trace' => $header."\n[stacktrace]\n".$exception->getTraceAsString(),
];
}

Expand Down

0 comments on commit a352130

Please sign in to comment.