Fix the log levels not to print out too much information
authorJuho Vähä-Herttua <juhovh@iki.fi>
Fri, 9 Mar 2012 16:08:42 +0000 (18:08 +0200)
committerJuho Vähä-Herttua <juhovh@iki.fi>
Wed, 16 May 2012 21:33:31 +0000 (00:33 +0300)
src/httpd.c
src/raop.c
src/raop_rtp.c

index 8a5dcba406f5a61c8d66b8b6365c81e94bf03fed..5779c0646e6501c8b012ba815bf547c891bf99d0 100644 (file)
@@ -216,7 +216,7 @@ httpd_thread(void *arg)
                                assert(connection->request);
                        }
 
-                       logger_log(httpd->logger, LOGGER_INFO, "Receiving on socket %d\n", httpd->connections[i].socket_fd);
+                       logger_log(httpd->logger, LOGGER_DEBUG, "Receiving on socket %d\n", httpd->connections[i].socket_fd);
                        ret = recv(connection->socket_fd, buffer, sizeof(buffer), 0);
                        if (ret == 0) {
                                logger_log(httpd->logger, LOGGER_INFO, "Connection closed\n");
index a83bb98e381056c6ff0b89a6a1f42e69a6825892..484b3f4774c2ef9cd3ed030048e43dbdb57352ce 100644 (file)
@@ -62,6 +62,7 @@ conn_init(void *opaque, unsigned char *local, int locallen, unsigned char *remot
        for (i=0; i<locallen; i++) {
                logger_log(&conn->raop->logger, LOGGER_INFO, "%02x", local[i]);
        }
+       logger_log(&conn->raop->logger, LOGGER_INFO, "\n");
        logger_log(&conn->raop->logger, LOGGER_INFO, "Remote: ");
        for (i=0; i<remotelen; i++) {
                logger_log(&conn->raop->logger, LOGGER_INFO, "%02x", remote[i]);
@@ -109,7 +110,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
                memset(signature, 0, sizeof(signature));
                rsakey_sign(raop->rsakey, signature, sizeof(signature), challenge,
                            conn->local, conn->locallen, raop->hwaddr, raop->hwaddrlen);
-               logger_log(&conn->raop->logger, LOGGER_INFO, "Got signature: %s\n", signature);
+               logger_log(&conn->raop->logger, LOGGER_DEBUG, "Got signature: %s\n", signature);
                http_response_add_header(res, "Apple-Response", signature);
        }
        if (!strcmp(method, "OPTIONS")) {
@@ -125,15 +126,15 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
                data = http_request_get_data(request, &datalen);
                if (data) {
                        sdp_t *sdp = sdp_init(data, datalen);
-                       logger_log(&conn->raop->logger, LOGGER_INFO, "rsaaeskey: %s\n", sdp_get_rsaaeskey(sdp));
-                       logger_log(&conn->raop->logger, LOGGER_INFO, "aesiv: %s\n", sdp_get_aesiv(sdp));
+                       logger_log(&conn->raop->logger, LOGGER_DEBUG, "rsaaeskey: %s\n", sdp_get_rsaaeskey(sdp));
+                       logger_log(&conn->raop->logger, LOGGER_DEBUG, "aesiv: %s\n", sdp_get_aesiv(sdp));
 
                        aeskeylen = rsakey_decrypt(raop->rsakey, aeskey, sizeof(aeskey),
                                                   sdp_get_rsaaeskey(sdp));
                        aesivlen = rsakey_parseiv(raop->rsakey, aesiv, sizeof(aesiv),
                                                  sdp_get_aesiv(sdp));
-                       logger_log(&conn->raop->logger, LOGGER_INFO, "aeskeylen: %d\n", aeskeylen);
-                       logger_log(&conn->raop->logger, LOGGER_INFO, "aesivlen: %d\n", aesivlen);
+                       logger_log(&conn->raop->logger, LOGGER_DEBUG, "aeskeylen: %d\n", aeskeylen);
+                       logger_log(&conn->raop->logger, LOGGER_DEBUG, "aesivlen: %d\n", aesivlen);
 
                        conn->raop_rtp = raop_rtp_init(&raop->logger, &raop->callbacks, sdp_get_fmtp(sdp), aeskey, aesiv);
                        sdp_destroy(sdp);
@@ -152,7 +153,6 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
 
                /* FIXME: Should use the parsed ports for resend */
                raop_rtp_start(conn->raop_rtp, use_udp, 1234, 1234, &cport, &tport, &dport);
-               logger_log(&conn->raop->logger, LOGGER_INFO, "cport %d tport %d dport %d\n", cport, tport, dport);
 
                memset(buffer, 0, sizeof(buffer));
                if (use_udp) {
@@ -202,7 +202,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response)
        }
        http_response_finish(res, NULL, 0);
 
-       logger_log(&conn->raop->logger, LOGGER_INFO, "Got request %s with URL %s\n", method, http_request_get_url(request));
+       logger_log(&conn->raop->logger, LOGGER_DEBUG, "Got request %s with URL %s\n", method, http_request_get_url(request));
        *response = res;
 }
 
index 075770c4b97088934164cedb072c2defd8d55895..0ef47c42614ffb88c3f4f04573c91c9c24563905 100644 (file)
@@ -140,7 +140,7 @@ raop_rtp_resend_callback(void *opaque, unsigned short seqnum, unsigned short cou
        addr = (struct sockaddr *)&raop_rtp->control_saddr;
        addrlen = raop_rtp->control_saddr_len;
 
-       logger_log(raop_rtp->logger, LOGGER_INFO, "Got resend request %d %d\n", seqnum, count);
+       logger_log(raop_rtp->logger, LOGGER_DEBUG, "Got resend request %d %d\n", seqnum, count);
        ourseqnum = raop_rtp->control_seqnum++;
 
        /* Fill the request buffer */
@@ -246,7 +246,7 @@ raop_rtp_thread_udp(void *arg)
                        if (packetlen >= 12) {
                                char type = packet[1] & ~0x80;
 
-                               logger_log(raop_rtp->logger, LOGGER_INFO, "Got control packet of type 0x%02x\n", type);
+                               logger_log(raop_rtp->logger, LOGGER_DEBUG, "Got control packet of type 0x%02x\n", type);
                                if (type == 0x56) {
                                        /* Handle resent data packet */
                                        int ret = raop_buffer_queue(raop_rtp->buffer, packet+4, packetlen-4, 1);