Skip to content

Commit

Permalink
fix(logging): update log format
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Oct 10, 2024
1 parent aae911d commit e015767
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Pdk/Logger/PsLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ public function __construct(FileSystemInterface $fileSystem)
* @param array $context
*
* @return void
* @noinspection JsonEncodingApiUsageInspection
*/
public function log($level, $message, array $context = []): void
{
$logger = $this->getLogger($level);
$fullMessage = empty($context)
? $message
: sprintf("%s\n%s", $message, json_encode(Utils::filterNull($context), JSON_PRETTY_PRINT));
: sprintf('%s %s', $message, json_encode(Utils::filterNull($context)));

$logger->log($fullMessage, $this->mapLevel($level));
}
Expand Down

0 comments on commit e015767

Please sign in to comment.