diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-11 12:35:47 +0100 |
commit | 19985dbb8c0aa66dc4bf7905abc1148de909097d (patch) | |
tree | 2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /admin/survey/minify/lib/Minify/Logger | |
download | 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst 1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip |
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']);
+ }
+}
|