# wp-optimize/4.5.2/vendor/mrclay/minify/lib/Minify/Logger/LegacyHandler.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 4.5.2. 25 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/4.5.2/code/vendor/mrclay/minify/lib/Minify/Logger/LegacyHandler.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/4.5.2/raw/vendor/mrclay/minify/lib/Minify/Logger/LegacyHandler.php
- Modified: 2021-06-07T22:42:16+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/wp-optimize/4.5.2/code/vendor/mrclay/minify/lib/Minify/Logger/LegacyHandler.php#L10-L20`.

```php
<?php

namespace Minify\Logger;

use Monolog\Handler\AbstractProcessingHandler;

class LegacyHandler extends AbstractProcessingHandler
{
    private $obj;

    public function __construct($obj)
    {
        if (!is_callable(array($obj, 'log'))) {
            throw new \InvalidArgumentException('$obj must have a public log() method');
        }
        $this->obj = $obj;
        parent::__construct();
    }

    protected function write(array $record)
    {
        $this->obj->log((string)$record['formatted']);
    }
}

```
