Add support for debug messages

Add new DEBUG_LOG macro for debug messages. The messages are enabled
when compiled with --enable-debug and they are printed when the -d
option is used twice.
This commit is contained in:
Miroslav Lichvar
2013-11-26 18:53:10 +01:00
parent 0731cd6950
commit 4bbc5520b8
6 changed files with 42 additions and 5 deletions

6
main.c
View File

@@ -326,7 +326,7 @@ int main
} else if (!strcmp("-n", *argv)) {
nofork = 1;
} else if (!strcmp("-d", *argv)) {
debug = 1;
debug++;
nofork = 1;
} else if (!strcmp("-4", *argv)) {
address_family = IPADDR_INET4;
@@ -352,6 +352,10 @@ int main
LOG_OpenSystemLog();
}
if (debug > 1) {
LOG_EnableDebug();
}
LOG(LOGS_INFO, LOGF_Main, "chronyd version %s starting", CHRONY_VERSION);
DNS_SetAddressFamily(address_family);