NullHandler.php 732 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Monolog package.
  4. *
  5. * (c) Jordi Boggiano <j.boggiano@seld.be>
  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 Monolog\Handler;
  11. use Monolog\Logger;
  12. /**
  13. * Blackhole
  14. *
  15. * Any record it can handle will be thrown away. This can be used
  16. * to put on top of an existing stack to override it temporarily.
  17. *
  18. * @author Jordi Boggiano <j.boggiano@seld.be>
  19. */
  20. class NullHandler extends AbstractHandler
  21. {
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function handle(array $record)
  26. {
  27. if ($record['level'] < $this->level) {
  28. return false;
  29. }
  30. return true;
  31. }
  32. }