From a57a1842df1cec22d38b0c1bde78ab0791160e9a Mon Sep 17 00:00:00 2001 From: Hector Mendoza Jacobo Date: Mon, 11 Nov 2024 20:01:50 +0000 Subject: [PATCH] Update the StdOutLogger to use Psr the LoggerTrait --- src/Logging/StdOutLogger.php | 67 ++---------------------------------- 1 file changed, 3 insertions(+), 64 deletions(-) diff --git a/src/Logging/StdOutLogger.php b/src/Logging/StdOutLogger.php index 220136757..01aabaf2e 100644 --- a/src/Logging/StdOutLogger.php +++ b/src/Logging/StdOutLogger.php @@ -19,6 +19,7 @@ use InvalidArgumentException; use Psr\Log\LoggerInterface; +use Psr\Log\LoggerTrait; use Psr\Log\LogLevel; use Stringable; @@ -27,6 +28,8 @@ */ class StdOutLogger implements LoggerInterface { + use LoggerTrait; + /** * @var array */ @@ -52,70 +55,6 @@ public function __construct(string $level = LogLevel::DEBUG) $this->level = $this->getLevelMap($level); } - /** - * {@inheritdoc} - */ - public function emergency(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::EMERGENCY, $message); - } - - /** - * {@inheritdoc} - */ - public function alert(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::ALERT, $message); - } - - /** - * {@inheritdoc} - */ - public function critical(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::CRITICAL, $message); - } - - /** - * {@inheritdoc} - */ - public function error(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::ERROR, $message); - } - - /** - * {@inheritdoc} - */ - public function warning(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::WARNING, $message); - } - - /** - * {@inheritdoc} - */ - public function notice(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::NOTICE, $message); - } - - /** - * {@inheritdoc} - */ - public function info(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::INFO, $message); - } - - /** - * {@inheritdoc} - */ - public function debug(string|Stringable $message, array $context = []): void - { - $this->log(LogLevel::DEBUG, $message); - } - /** * {@inheritdoc} */