Debugger.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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\Bundle\FrameworkBundle\Templating;
  11. @trigger_error('The '.__NAMESPACE__.'\Debugger class is deprecated since Symfony 2.4 and will be removed in 3.0. Use the Psr\Log\LoggerInterface interface instead.', E_USER_DEPRECATED);
  12. use Psr\Log\LoggerInterface;
  13. use Symfony\Component\Templating\DebuggerInterface;
  14. /**
  15. * Binds the Symfony templating loader debugger to the Symfony logger.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. *
  19. * @deprecated since version 2.4, to be removed in 3.0.
  20. * Use Psr\Log\LoggerInterface instead.
  21. */
  22. class Debugger implements DebuggerInterface
  23. {
  24. protected $logger;
  25. public function __construct(LoggerInterface $logger = null)
  26. {
  27. $this->logger = $logger;
  28. }
  29. /**
  30. * Logs a message.
  31. *
  32. * @param string $message A message to log
  33. */
  34. public function log($message)
  35. {
  36. if (null !== $this->logger) {
  37. $this->logger->debug($message);
  38. }
  39. }
  40. }