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