Logger.php 976 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bridge\Monolog;
  11. use Monolog\Logger as BaseLogger;
  12. use Symfony\Component\HttpKernel\Log\LoggerInterface;
  13. use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
  14. /**
  15. * Logger.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. class Logger extends BaseLogger implements LoggerInterface
  20. {
  21. /**
  22. * Returns a DebugLoggerInterface instance if one is registered with this logger.
  23. *
  24. * @return DebugLoggerInterface A DebugLoggerInterface instance or null if none is registered
  25. */
  26. public function getDebugLogger()
  27. {
  28. foreach ($this->handlers as $handler) {
  29. if ($handler instanceof DebugLoggerInterface) {
  30. return $handler;
  31. }
  32. }
  33. }
  34. }