aboutsummaryrefslogtreecommitdiff
path: root/src/Log.php
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-02-07 09:44:59 +0100
committerLaria Carolin Chabowski <laria@laria.me>2020-02-07 09:44:59 +0100
commit2eb5a432d2229788ce2fdb09f36c6f4bebdea813 (patch)
treeab57978bdda34c82b025b897cfb6825b1fd1e654 /src/Log.php
downloadmicropoly-2eb5a432d2229788ce2fdb09f36c6f4bebdea813.tar.gz
micropoly-2eb5a432d2229788ce2fdb09f36c6f4bebdea813.tar.bz2
micropoly-2eb5a432d2229788ce2fdb09f36c6f4bebdea813.zip
Initial commit
Diffstat (limited to 'src/Log.php')
-rw-r--r--src/Log.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Log.php b/src/Log.php
new file mode 100644
index 0000000..fce455f
--- /dev/null
+++ b/src/Log.php
@@ -0,0 +1,27 @@
+<?php
+
+
+namespace Micropoly;
+
+
+use Monolog\Handler\ErrorLogHandler;
+use Monolog\Logger;
+use Psr\Log\LoggerInterface;
+
+class Log
+{
+ public static function logger(): LoggerInterface
+ {
+ static $logger = null;
+ if ($logger === null)
+ $logger = self::initLogger();
+ return $logger;
+ }
+
+ private static function initLogger(): Logger
+ {
+ $logger = new Logger("logger");
+ $logger->pushHandler(new ErrorLogHandler());
+ return $logger;
+ }
+} \ No newline at end of file