Skip to content

Commit 6852047

Browse files
committed
only log diagnostic events if a treshhold is set
this prevents log spam and it's rare that you actually want to very short events logged anyway Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 52bb29b commit 6852047

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

config/config.sample.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@
17911791

17921792
/**
17931793
* Enforce the user theme. This will disable the user theming settings
1794-
* This must be a valid ITheme ID.
1794+
* This must be a valid ITheme ID.
17951795
* E.g. light, dark, highcontrast, dark-highcontrast...
17961796
*/
17971797
'enforce_theme' => '',
@@ -2146,6 +2146,8 @@
21462146

21472147
/**
21482148
* Limit diagnostics event logging to events longer than the configured threshold in ms
2149+
*
2150+
* when set to 0 no diagnostics events will be logged
21492151
*/
21502152
'diagnostics.logging.threshold' => 0,
21512153

lib/private/Diagnostics/EventLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function writeLog(IEvent $event) {
126126
$timeInMs = round($duration * 1000, 4);
127127

128128
$loggingMinimum = (int)$this->config->getValue('diagnostics.logging.threshold', 0);
129-
if ($loggingMinimum > 0 && $timeInMs < $loggingMinimum) {
129+
if ($loggingMinimum == 0 || $timeInMs < $loggingMinimum) {
130130
return;
131131
}
132132

0 commit comments

Comments
 (0)