logging: refactor enabling of debug messages

Reorder the LOGS_Severity enum in order of severity and change the code
to not log/print messages with severity below the specified minimum
instead of having a separate debug level.
This commit is contained in:
Miroslav Lichvar
2019-07-02 16:18:06 +02:00
parent d30e73d0d9
commit 1227873b88
4 changed files with 22 additions and 29 deletions

2
main.c
View File

@@ -510,7 +510,7 @@ int main
LOG_OpenSystemLog();
}
LOG_SetDebugLevel(debug);
LOG_SetMinSeverity(debug >= 2 ? LOGS_DEBUG : LOGS_INFO);
LOG(LOGS_INFO, "chronyd version %s starting (%s)", CHRONY_VERSION, CHRONYD_FEATURES);