]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Page.php
Merge pull request #11647 from Quix0r/fixes/type-error-exception
[friendica.git] / src / App / Page.php
index 305b2962b9c70e856ba31c67ab28394e82d1c457..d38757687c99929bd62b8055fa7d78be1ac6a317 100644 (file)
@@ -98,10 +98,16 @@ class Page implements ArrayAccess
                $this->method  = $method;
        }
 
-       public function logRuntime()
+       public function logRuntime(IManageConfigValues $config, string $origin = '')
        {
+               if (in_array($this->command, $config->get('system', 'runtime_ignore'))) {
+                       return;
+               }
+
                $runtime = number_format(microtime(true) - $this->timestamp, 3);
-               Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime]);
+               if ($runtime > $config->get('system', 'runtime_loglimit')) {
+                       Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime, 'origin' => $origin]);
+               }
        }
 
        /**