fprintf -> TRACE
authorroot <root@xenapi.xen>
Fri, 3 Oct 2008 22:15:32 +0000 (4 00:15 +0200)
committerroot <root@xenapi.xen>
Fri, 3 Oct 2008 22:15:32 +0000 (4 00:15 +0200)
handler_virt_tender.c

index 7a6e44a..715b42d 100644 (file)
@@ -59,7 +59,7 @@ static void tender_resolve_callback(
 
     switch (event) {
         case AVAHI_RESOLVER_FAILURE:
-            // fprintf(stderr, "(Resolver) FAILURE!\n");
+            TRACE("avahi", "(Resolver) FAILURE!\n");
             avahi_service_resolver_free(r);
             break;
 
@@ -67,11 +67,11 @@ static void tender_resolve_callback(
             char a[AVAHI_ADDRESS_STR_MAX], *t;
             AvahiStringList *needle;
 
-//            fprintf(stderr, "(Resolver) Service '%s' of type '%s' in domain '%s':\n", name, type, domain);
+            TRACE("avahi", "(Resolver) Service '%s' of type '%s' in domain '%s':\n", name, type, domain);
 
             avahi_address_snprint(a, sizeof(a), address);
             t = avahi_string_list_to_string(txt);
-/*            fprintf(stderr,
+            TRACE("avahi",
                     "\t%s:%u (%s)\n"
                     "\tTXT=%s\n"
                     "\tcookie is %u\n"
@@ -87,7 +87,7 @@ static void tender_resolve_callback(
                     !!(flags & AVAHI_LOOKUP_RESULT_OUR_OWN),
                     !!(flags & AVAHI_LOOKUP_RESULT_WIDE_AREA),
                     !!(flags & AVAHI_LOOKUP_RESULT_MULTICAST),
-                    !!(flags & AVAHI_LOOKUP_RESULT_CACHED));*/
+                    !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
 
 
             avahi_free(t);
@@ -138,11 +138,11 @@ static void tender_browse_callback(
 
     switch (event) {
         case AVAHI_BROWSER_FAILURE:
-            fprintf(stderr, "(Browser) %s\n", avahi_strerror(avahi_client_errno(c)));
+            TRACE("avahi", "(Browser) %s\n", avahi_strerror(avahi_client_errno(c)));
             return;
 
         case AVAHI_BROWSER_NEW:
-            fprintf(stderr, "(Browser) NEW: service '%s' of type '%s' in domain '%s'\n", name, type, domain);
+            TRACE("avahi", "(Browser) NEW: service '%s' of type '%s' in domain '%s'\n", name, type, domain);
 
             /* We ignore the returned resolver object. In the callback
                function we free it. If the server is terminated before
@@ -150,17 +150,17 @@ static void tender_browse_callback(
                the resolver for us. */
 
             if (!(avahi_service_resolver_new(c, interface, protocol, name, type, domain, AVAHI_PROTO_UNSPEC, 0, tender_resolve_callback, userdata)))
-                fprintf(stderr, "Failed to resolve service '%s': %s\n", name, avahi_strerror(avahi_client_errno(c)));
+                TRACE("avahi", "Failed to resolve service '%s': %s\n", name, avahi_strerror(avahi_client_errno(c)));
 
             break;
 
         case AVAHI_BROWSER_REMOVE:
-            fprintf(stderr, "%s, (Browser) REMOVE: service '%s' of type '%s' in domain '%s'\n", __func__, name, type, domain);
+            TRACE("avahi", "%s, (Browser) REMOVE: service '%s' of type '%s' in domain '%s'\n", __func__, name, type, domain);
             break;
 
         case AVAHI_BROWSER_ALL_FOR_NOW:
         case AVAHI_BROWSER_CACHE_EXHAUSTED:
-            fprintf(stderr, "(Browser) %s\n", event == AVAHI_BROWSER_CACHE_EXHAUSTED ? "CACHE_EXHAUSTED" : "ALL_FOR_NOW");
+            TRACE("avahi", "(Browser) %s\n", event == AVAHI_BROWSER_CACHE_EXHAUSTED ? "CACHE_EXHAUSTED" : "ALL_FOR_NOW");
             break;
     }
 }