Skip to content

Commit

Permalink
Log messages from getdns have '\n' at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
wtoorop committed Dec 22, 2022
1 parent 0122bc0 commit 8571f6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions src/stubby.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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]) {
Expand All @@ -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
Expand Down

0 comments on commit 8571f6a

Please sign in to comment.