diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-06-08 21:19:03 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-06-08 21:19:03 +0200 |
commit | bc0d461e2a20c82e38d5697fa172438704d77c99 (patch) | |
tree | a5c95dcabec2eed44df2b4e72e4736ead92f3350 | |
parent | 03cc9def3f25394ab1564062ae44942218280710 (diff) | |
download | vconsole-bc0d461e2a20c82e38d5697fa172438704d77c99.tar.gz |
fix debug log, whitespace cleaups
-rw-r--r-- | mdns-publish.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mdns-publish.c b/mdns-publish.c index 868a7b9..e69032f 100644 --- a/mdns-publish.c +++ b/mdns-publish.c @@ -24,7 +24,7 @@ struct mdns_pub { int have_tty; int have_syslog; int debug; - + AvahiThreadedPoll *thread_poll; AvahiClient *client; @@ -76,7 +76,7 @@ static void entry_group_callback(AvahiEntryGroup *g, mdns_log_printf(entry->mdns, LOG_DEBUG, "%s: %s: state %d [%s]\n", __FUNCTION__, entry->name, state, group_state_name[state]); - + switch (state) { case AVAHI_ENTRY_GROUP_COLLISION: n = avahi_alternative_service_name(entry->name); @@ -361,7 +361,8 @@ int mdns_log_printf(struct mdns_pub *mdns, int priority, rc = vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); va_end(args); - if (!mdns || mdns->have_tty) + if (!mdns || (mdns->have_tty && (mdns->debug || + priority != LOG_DEBUG))) fprintf(stderr, "%s: %s", mdns_pub_appname, msgbuf); if (mdns && mdns->have_syslog) syslog(priority, "%s", msgbuf); |