# HG changeset patch # User Sebastien Decugis # Date 1370017773 -7200 # Node ID a4604f98adae5616004777051ba2a3921de9583e # Parent eaa92af9e46d9f57a3dae263b7b4d02d631813fb Split output of fd_msg_dump_treeview diff -r eaa92af9e46d -r a4604f98adae extensions/dbg_msg_dumps/dbg_msg_dumps.c --- a/extensions/dbg_msg_dumps/dbg_msg_dumps.c Fri May 31 18:15:05 2013 +0200 +++ b/extensions/dbg_msg_dumps/dbg_msg_dumps.c Fri May 31 18:29:33 2013 +0200 @@ -50,10 +50,10 @@ CHECK_MALLOC_DO( fd_msg_dump_treeview(&buf, &len, NULL, msg, fd_g_config->cnf_dict, 1, 1), { LOG_E("Error while dumping a message"); return; } ); - LOG_N("%s %s: %s", + LOG_N("%s %s:", (type == HOOK_MESSAGE_RECEIVED) ? "RCV FROM" : "SENT TO", - peer ? peer->info.pi_diamid:"", - buf); + peer ? peer->info.pi_diamid:""); + LOG_SPLIT( FD_LOG_NOTICE, " ", buf ?:"", NULL); free(buf); } diff -r eaa92af9e46d -r a4604f98adae libfdcore/hooks.c --- a/libfdcore/hooks.c Fri May 31 18:15:05 2013 +0200 +++ b/libfdcore/hooks.c Fri May 31 18:29:33 2013 +0200 @@ -359,7 +359,7 @@ CHECK_MALLOC_DO(fd_msg_dump_treeview(&buf, &len, NULL, msg, NULL, 0, 1), break); LOG_E("Parsing error: '%s' for the following message received from '%s':", (char *)other, (char *)id); - LOG_E("%s", buf); + LOG_SPLIT(FD_LOG_ERROR, " ", buf?:"", NULL); } else { struct fd_cnx_rcvdata *rcv_data = other; CHECK_MALLOC_DO(fd_dump_extend_hexdump(&buf, &len, NULL, rcv_data->buffer, rcv_data->length, 0, 0), break); @@ -379,7 +379,7 @@ CHECK_MALLOC_DO(fd_msg_dump_treeview(&buf, &len, NULL, msg, NULL, 0, 1), break); LOG_E("Routing error: '%s' for the following message:", (char *)other); - LOG_E("%s", buf); + LOG_SPLIT(FD_LOG_ERROR, " ", buf?:"", NULL); break; } @@ -398,16 +398,15 @@ case HOOK_MESSAGE_DROPPED: { CHECK_MALLOC_DO(fd_msg_dump_treeview(&buf, &len, NULL, msg, NULL, 0, 1), break); LOG_E("Message discarded ('%s'):", (char *)other); - LOG_E("%s", buf); + LOG_SPLIT(FD_LOG_ERROR, " ", buf?:"", NULL); break; } case HOOK_PEER_CONNECT_FAILED: { if (msg) { - size_t offset = 0; - CHECK_MALLOC_DO(fd_dump_extend(&buf, &len, &offset, " CER/CEA dump:\n"), break); - CHECK_MALLOC_DO(fd_msg_dump_treeview(&buf, &len, &offset, msg, NULL, 0, 1), break); - LOG_N("Connection to '%s' failed: %s%s", peer ? peer->p_hdr.info.pi_diamid : "", (char *)other, buf); + CHECK_MALLOC_DO(fd_msg_dump_treeview(&buf, &len, NULL, msg, NULL, 0, 1), break); + LOG_N("Connection to '%s' failed: '%s'; CER/CEA dump:", peer ? peer->p_hdr.info.pi_diamid : "", (char *)other); + LOG_SPLIT(FD_LOG_NOTICE, " ", buf?:"", NULL); } else { LOG_D("Connection to '%s' failed: %s", peer ? peer->p_hdr.info.pi_diamid : "", (char *)other); } @@ -420,7 +419,8 @@ fd_msg_answ_getq(msg, &msg); /* We dump the CER in that case */ } CHECK_MALLOC_DO(fd_msg_dump_treeview(&buf, &len, NULL, msg, NULL, 0, 1), break); - LOG_N("Connected to '%s', remote capabilities: %s", peer ? peer->p_hdr.info.pi_diamid : "", buf); + LOG_N("Connected to '%s', remote capabilities: ", peer ? peer->p_hdr.info.pi_diamid : ""); + LOG_SPLIT(FD_LOG_NOTICE, " ", buf?:"", NULL); break; }