# give/4.16.1/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.1. 30 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.1/code/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php
- Raw: https://pluginprobe.com/plugins/give/4.16.1/raw/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php
- Modified: 2021-09-27T12:30:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.16.1/code/vendor/stripe/stripe-php/lib/Util/DefaultLogger.php#L10-L20`.

```php
<?php

namespace Stripe\Util;

/**
 * A very basic implementation of LoggerInterface that has just enough
 * functionality that it can be the default for this library.
 */
class DefaultLogger implements LoggerInterface
{
    /** @var int */
    public $messageType = 0;

    /** @var null|string */
    public $destination;

    public function error($message, array $context = [])
    {
        if (\count($context) > 0) {
            throw new \Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.');
        }

        if (null === $this->destination) {
            \error_log($message, $this->messageType);
        } else {
            \error_log($message, $this->messageType, $this->destination);
        }
    }
}

```
