LoggerAwareTrait.php 402 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Psr\Log;
  3. /**
  4. * Basic Implementation of LoggerAwareInterface.
  5. */
  6. trait LoggerAwareTrait
  7. {
  8. /**
  9. * The logger instance.
  10. *
  11. * @var LoggerInterface|null
  12. */
  13. protected $logger;
  14. /**
  15. * Sets a logger.
  16. *
  17. * @param LoggerInterface $logger
  18. */
  19. public function setLogger(LoggerInterface $logger)
  20. {
  21. $this->logger = $logger;
  22. }
  23. }