Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: getLogLevel return type
Signed-off-by: skjnldsv <[email protected]>
  • Loading branch information
skjnldsv committed Mar 17, 2024
commit a47a70790ca085bcc08cdb050785190a295a8be6
3 changes: 2 additions & 1 deletion lib/private/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ public function getLogLevel($context): int {
}
}

return min($this->config->getValue('loglevel', ILogger::WARN) ?? ILogger::WARN, ILogger::FATAL);
$configLogLevel = $this->config->getValue('loglevel', ILogger::WARN);
return min(is_int($configLogLevel) ? $configLogLevel : ILogger::WARN, ILogger::FATAL);
Comment on lines +284 to +285
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @susnux pointed out we should log an error or cast the value to int.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ref #44262

}

/**
Expand Down