aos/network: fix up logging, especially VLOG
Make it so that VLOG(1) is not overwhelming and mostly
shows us changes related to association changes.
Also show more useful messages that tell us more about
what is going on by including per-connection information.
Change-Id: I079a849afd63da03ba2e76a6c3f631455ed7e480
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/network/sctp_lib.cc b/aos/network/sctp_lib.cc
index 5bc1b37..21c0b78 100644
--- a/aos/network/sctp_lib.cc
+++ b/aos/network/sctp_lib.cc
@@ -23,7 +23,7 @@
namespace {
const char *sac_state_tbl[] = {"COMMUNICATION_UP", "COMMUNICATION_LOST",
"RESTART", "SHUTDOWN_COMPLETE",
- "CANT_START_ASSOCICATION"};
+ "CANT_START_ASSOCIATION"};
typedef union {
struct sctp_initmsg init;
@@ -285,7 +285,7 @@
if (sockaddr_remote) {
outmsg.msg_name = &*sockaddr_remote;
outmsg.msg_namelen = sizeof(*sockaddr_remote);
- VLOG(1) << "Sending to " << Address(*sockaddr_remote);
+ VLOG(2) << "Sending to " << Address(*sockaddr_remote);
} else {
outmsg.msg_namelen = 0;
}
@@ -328,7 +328,7 @@
return false;
}
CHECK_EQ(static_cast<ssize_t>(data.size()), size);
- VLOG(1) << "Sent " << data.size();
+ VLOG(2) << "Sent " << data.size();
return true;
}
@@ -444,7 +444,7 @@
memcpy(partial_message->mutable_data() + partial_message->size,
result->data(), result->size);
++partial_message->partial_deliveries;
- VLOG(1) << "Merged fragment of " << result->size << " after "
+ VLOG(2) << "Merged fragment of " << result->size << " after "
<< partial_message->size << ", had "
<< partial_message->partial_deliveries
<< ", for: " << result->header.rcvinfo.rcv_sid << ","
@@ -472,7 +472,7 @@
return result;
}
if (partial_message_iterator == partial_messages_.end()) {
- VLOG(1) << "Starting fragment for: " << result->header.rcvinfo.rcv_sid
+ VLOG(2) << "Starting fragment for: " << result->header.rcvinfo.rcv_sid
<< "," << result->header.rcvinfo.rcv_ssn << ","
<< result->header.rcvinfo.rcv_assoc_id;
// Need to record this as the first fragment.