commit b551a2539103e0ef4eeaf166c781cacac03fc988
parent 05e326abe6b94551943ccf48076cb8f0f8cfbe00
Author: Branko Wilhelm <bwilhelm@eos-uptrade.de>
Date:   Thu, 16 May 2019 18:11:33 +0200
* handle log env settings (dooh)
Diffstat:
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/Config.php b/src/Config.php
@@ -31,6 +31,11 @@ final class Config
     private $customerId;
 
     /**
+     * @var bool
+     */
+    private $log = true;
+
+    /**
      * @var string
      */
     private $logFile;
@@ -105,6 +110,14 @@ final class Config
     }
 
     /**
+     * @return bool
+     */
+    public function isLog()
+    {
+        return $this->log;
+    }
+    
+    /**
      * @return string
      */
     public function getLogFile()
diff --git a/src/Handler.php b/src/Handler.php
@@ -72,6 +72,10 @@ final class Handler
 
     private function doExit()
     {
+        if (!$this->config->isLog()) {
+            return;
+        }
+
         // save only the newest 100 log entries for each domain
         $this->log[$this->payload->getDomain()] = array_reverse(array_slice(array_reverse($this->log[$this->payload->getDomain()]), 0, 100));