From 8571f6aba6827a74588f0d0e645d363c9ab045d1 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 22 Dec 2022 15:16:12 +0100 Subject: [PATCH] Log messages from getdns have '\n' at the end --- src/log.c | 2 -- src/stubby.c | 14 +++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/log.c b/src/log.c index 608bd5d..ae77202 100644 --- a/src/log.c +++ b/src/log.c @@ -41,7 +41,6 @@ static void default_stubby_verror(getdns_loglevel_type level, const char *fmt, v { (void) level; (void) vfprintf(stderr, fmt, ap); - (void) fputc('\n', stderr); } long log_level = GETDNS_LOG_DEBUG + 1; @@ -71,7 +70,6 @@ static void default_stubby_vlog(void *userarg, uint64_t system, (void)userarg; (void)system; (void)level; (void) fprintf(stderr, "[%s.%.6d] STUBBY: ", buf, (int)tv.tv_usec); (void) vfprintf(stderr, fmt, ap); - (void) fputc('\n', stderr); } static stubby_verror_t stubby_verror = default_stubby_verror; diff --git a/src/stubby.c b/src/stubby.c index 84d5517..3dd7b54 100644 --- a/src/stubby.c +++ b/src/stubby.c @@ -185,7 +185,7 @@ main(int argc, char **argv) log_level = config_log_level; } stubby_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_INFO, - "Stubby version: %s", STUBBY_PACKAGE_STRING); + "Stubby version: %s\n", STUBBY_PACKAGE_STRING); if (print_api_info) { char *api_information_str = config_get_api_info(context); @@ -256,13 +256,13 @@ main(int argc, char **argv) { /* Report basic config options which specifically affect privacy and validation*/ stubby_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_INFO, - "DNSSEC Validation is %s", dnssec_validation==1 ? "ON":"OFF"); + "DNSSEC Validation is %s\n", dnssec_validation==1 ? "ON":"OFF"); size_t transport_count = 0; getdns_transport_list_t *transport_list; getdns_context_get_dns_transport_list(context, &transport_count, &transport_list); stubby_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_INFO, - "Transport list is:"); + "Transport list is:\n"); for (size_t i = 0; i < transport_count; i++) { char* transport_name; switch (transport_list[i]) { @@ -280,19 +280,19 @@ main(int argc, char **argv) break; } stubby_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_INFO, - " - %s", transport_name); + " - %s\n", transport_name); } free(transport_list); getdns_tls_authentication_t auth; getdns_context_get_tls_authentication(context, &auth); stubby_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_INFO, - "Privacy Usage Profile is %s", + "Privacy Usage Profile is %s\n", auth==GETDNS_AUTHENTICATION_REQUIRED ? "Strict (Authentication required)":"Opportunistic"); stubby_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_INFO, - "(NOTE a Strict Profile only applies when TLS is the ONLY transport!!)"); + "(NOTE a Strict Profile only applies when TLS is the ONLY transport!!)\n"); stubby_log(NULL,GETDNS_LOG_UPSTREAM_STATS, GETDNS_LOG_DEBUG, - "Starting DAEMON...."); + "Starting DAEMON....\n"); #ifdef SIGPIPE (void)signal(SIGPIPE, SIG_IGN); #endif