NullLogger.php 651 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Psr\Log;
  3. /**
  4. * This Logger can be used to avoid conditional log calls.
  5. *
  6. * Logging should always be optional, and if no logger is provided to your
  7. * library creating a NullLogger instance to have something to throw logs at
  8. * is a good way to avoid littering your code with `if ($this->logger) { }`
  9. * blocks.
  10. */
  11. class NullLogger extends AbstractLogger
  12. {
  13. /**
  14. * Logs with an arbitrary level.
  15. *
  16. * @param mixed $level
  17. * @param string $message
  18. * @param array $context
  19. *
  20. * @return void
  21. */
  22. public function log($level, $message, array $context = array())
  23. {
  24. // noop
  25. }
  26. }