diff options
Diffstat (limited to 'admin/survey/minify/lib/Minify/Logger')
-rw-r--r-- | admin/survey/minify/lib/Minify/Logger/LegacyHandler.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/admin/survey/minify/lib/Minify/Logger/LegacyHandler.php b/admin/survey/minify/lib/Minify/Logger/LegacyHandler.php new file mode 100644 index 0000000..fe4800f --- /dev/null +++ b/admin/survey/minify/lib/Minify/Logger/LegacyHandler.php @@ -0,0 +1,24 @@ +<?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']);
+ }
+}
|