mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-25 04:19:15 -05:00
[logger] Return early if severity or domain do not match
This commit is contained in:
parent
b428760599
commit
4f811ff6e0
@ -164,6 +164,11 @@ DPRINTF(int severity, int domain, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
// If domain and severity do not match the current log configuration, return early to
|
||||
// safe some unnecessary code execution (tiny performance gain)
|
||||
if (logger_initialized && (!((1 << domain) & logdomains) || (severity > threshold)))
|
||||
return;
|
||||
|
||||
va_start(ap, fmt);
|
||||
vlogger(severity, domain, fmt, ap);
|
||||
va_end(ap);
|
||||
|
Loading…
x
Reference in New Issue
Block a user