diff options
Diffstat (limited to 'vendor/gipfl/log/src/AdditionalContextLogger.php')
-rw-r--r-- | vendor/gipfl/log/src/AdditionalContextLogger.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/gipfl/log/src/AdditionalContextLogger.php b/vendor/gipfl/log/src/AdditionalContextLogger.php new file mode 100644 index 0000000..92891c5 --- /dev/null +++ b/vendor/gipfl/log/src/AdditionalContextLogger.php @@ -0,0 +1,25 @@ +<?php + +namespace gipfl\Log; + +use Psr\Log\LoggerInterface; + +class AdditionalContextLogger extends Logger +{ + /** @var array */ + protected $context; + + /** @var LoggerInterface */ + protected $wrappedLogger; + + public function __construct(array $context, LoggerInterface $logger) + { + $this->context = $context; + $this->wrappedLogger = $logger; + } + + public function log($level, $message, array $context = []) + { + $this->wrappedLogger->log($level, $message, $context + $this->context); + } +} |