logger: add
authorMichael Wallner <mike@php.net>
Fri, 16 Dec 2016 09:15:50 +0000 (10:15 +0100)
committerMichael Wallner <mike@php.net>
Fri, 20 Dec 2019 12:21:59 +0000 (13:21 +0100)
app/Github/Logger.php [deleted file]
app/Logger.php [new file with mode: 0644]

diff --git a/app/Github/Logger.php b/app/Github/Logger.php
deleted file mode 100644 (file)
index d90e824..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-namespace app\Github;
-
-use app\Config;
-
-class Logger extends \Monolog\Logger
-{
-       function __construct(Config $config) {
-               $channel = $config->github->log;
-               parent::__construct($channel);
-               foreach ($config->log->$channel as $logger) {
-                       $reflection = new \ReflectionClass("Monolog\\Handler\\" . $logger->handler);
-                       if (!empty($logger->args)) {
-                               $handler = $reflection->newInstanceArgs($logger->args->toArray());
-                       } else {
-                               $handler = $reflection->newInstance();
-                       }
-                       $this->pushHandler($handler);
-               }
-       }
-}
diff --git a/app/Logger.php b/app/Logger.php
new file mode 100644 (file)
index 0000000..51e4803
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+namespace app;
+
+use app\Config;
+
+class Logger extends \Monolog\Logger
+{
+       function __construct(Config $config, $channel) {
+               parent::__construct($channel);
+               foreach ($config->log->$channel as $logger) {
+                       $reflection = new \ReflectionClass("Monolog\\Handler\\" . $logger->handler);
+                       if (!empty($logger->args)) {
+                               $handler = $reflection->newInstanceArgs($logger->args->toArray());
+                       } else {
+                               $handler = $reflection->newInstance();
+                       }
+                       $this->pushHandler($handler);
+               }
+       }
+}