From 4f07bf8a8560a22e2bc194697d54af0625df97e7 Mon Sep 17 00:00:00 2001 From: Pawel Trauth Date: Tue, 17 Dec 2019 12:35:08 +0000 Subject: [PATCH] fix: provide default argument for logging context methods --- src/EventStore.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EventStore.php b/src/EventStore.php index eab037f..ea2eaad 100644 --- a/src/EventStore.php +++ b/src/EventStore.php @@ -51,7 +51,7 @@ public static function eventToClass(?callable $callback = null) */ public static function workerLogger(?callable $logger = null) { - static::$workerLogger = $logger ?: function($message, $context){ + static::$workerLogger = $logger ?: function($message, $context = []){ Log::info($message, $context); }; } @@ -64,7 +64,7 @@ public static function workerLogger(?callable $logger = null) */ public static function threadLogger(?callable $logger = null) { - static::$threadLogger = $logger ?: function($message, $context){ + static::$threadLogger = $logger ?: function($message, $context = []){ Log::channel('stdout')->info($message, $context); }; @@ -78,7 +78,7 @@ public static function threadLogger(?callable $logger = null) 'handler' => \Monolog\Handler\StreamHandler::class, 'formatter' => \Monolog\Formatter\LineFormatter::class, 'formatter_with' => [ - 'format' => "%message% %context%", + 'format' => "%message% %context%\n", ], 'with' => [ 'stream' => 'php://stdout',