xref: /plugin/smtp/subtree/php-fig/log/Psr/Log/LoggerAwareTrait.php (revision ae1ee236f55bbd7fd5e41a98f6cc93dbe5a5b903)
1*ae1ee236SAndreas Gohr<?php
2*ae1ee236SAndreas Gohr
3*ae1ee236SAndreas Gohrnamespace Psr\Log;
4*ae1ee236SAndreas Gohr
5*ae1ee236SAndreas Gohr/**
6*ae1ee236SAndreas Gohr * Basic Implementation of LoggerAwareInterface.
7*ae1ee236SAndreas Gohr */
8*ae1ee236SAndreas Gohrtrait LoggerAwareTrait
9*ae1ee236SAndreas Gohr{
10*ae1ee236SAndreas Gohr    /**
11*ae1ee236SAndreas Gohr     * The logger instance.
12*ae1ee236SAndreas Gohr     *
13*ae1ee236SAndreas Gohr     * @var LoggerInterface
14*ae1ee236SAndreas Gohr     */
15*ae1ee236SAndreas Gohr    protected $logger;
16*ae1ee236SAndreas Gohr
17*ae1ee236SAndreas Gohr    /**
18*ae1ee236SAndreas Gohr     * Sets a logger.
19*ae1ee236SAndreas Gohr     *
20*ae1ee236SAndreas Gohr     * @param LoggerInterface $logger
21*ae1ee236SAndreas Gohr     */
22*ae1ee236SAndreas Gohr    public function setLogger(LoggerInterface $logger)
23*ae1ee236SAndreas Gohr    {
24*ae1ee236SAndreas Gohr        $this->logger = $logger;
25*ae1ee236SAndreas Gohr    }
26*ae1ee236SAndreas Gohr}
27