LoggerInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Stripe\Util;
  3. /**
  4. * Describes a logger instance.
  5. *
  6. * This is a subset of the interface of the same name in the PSR-3 logger
  7. * interface. We guarantee to keep it compatible, but we'd redefined it here so
  8. * that we don't have to pull in the extra dependencies for users who don't want
  9. * it.
  10. *
  11. * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
  12. * for the full interface specification.
  13. *
  14. * The message MUST be a string or object implementing __toString().
  15. *
  16. * The message MAY contain placeholders in the form: {foo} where foo
  17. * will be replaced by the context data in key "foo".
  18. *
  19. * The context array can contain arbitrary data, the only assumption that
  20. * can be made by implementors is that if an Exception instance is given
  21. * to produce a stack trace, it MUST be in a key named "exception".
  22. */
  23. interface LoggerInterface
  24. {
  25. /**
  26. * Runtime errors that do not require immediate action but should typically
  27. * be logged and monitored.
  28. *
  29. * @param string $message
  30. */
  31. public function error($message, array $context = []);
  32. }