ApiVersion.php
2 months ago
CaseInsensitiveArray.php
2 months ago
DefaultLogger.php
2 months ago
EventTypes.php
2 months ago
LoggerInterface.php
2 months ago
ObjectTypes.php
2 months ago
RandomGenerator.php
2 months ago
RequestOptions.php
2 months ago
Set.php
2 months ago
Util.php
2 months ago
DefaultLogger.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | namespace ProfilePressVendor\Stripe\Util; |
| 4 | |
| 5 | /** |
| 6 | * A very basic implementation of LoggerInterface that has just enough |
| 7 | * functionality that it can be the default for this library. |
| 8 | */ |
| 9 | class DefaultLogger implements LoggerInterface |
| 10 | { |
| 11 | /** @var int */ |
| 12 | public $messageType = 0; |
| 13 | /** @var null|string */ |
| 14 | public $destination; |
| 15 | public function error($message, array $context = []) |
| 16 | { |
| 17 | if (\count($context) > 0) { |
| 18 | throw new \ProfilePressVendor\Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.'); |
| 19 | } |
| 20 | if (null === $this->destination) { |
| 21 | \error_log($message, $this->messageType); |
| 22 | } else { |
| 23 | \error_log($message, $this->messageType, $this->destination); |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 |