From 544de86739a85792be7e6883968b2af8590d0711 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 31 Aug 2014 14:11:23 +0300 Subject: Add comments for outbound packet fields in debug log. --- src/net/messageout.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/net/messageout.cpp') diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index 16b205373..ff778d89a 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -45,16 +45,18 @@ MessageOut::MessageOut(const int16_t id A_UNUSED) : DEBUGLOG("MessageOut"); } -void MessageOut::writeInt8(const int8_t value) +void MessageOut::writeInt8(const int8_t value, const char *const str) { - DEBUGLOG("writeInt8: " + toStringPrint(static_cast(value))); + DEBUGLOG2("writeInt8: " + toStringPrint(static_cast(value)), str); expand(1); mData[mPos] = value; mPos += 1; PacketCounters::incOutBytes(1); } -void MessageOut::writeString(const std::string &string, int length) +void MessageOut::writeString(const std::string &string, + int length, + const char *const str) { int stringLength = static_cast(string.length()); if (length < 0) @@ -82,11 +84,13 @@ void MessageOut::writeString(const std::string &string, int length) } mPos += length; - DEBUGLOG("writeString: " + string); + DEBUGLOG2("writeString: " + string, str); PacketCounters::incOutBytes(length); } -void MessageOut::writeStringNoLog(const std::string &string, int length) +void MessageOut::writeStringNoLog(const std::string &string, + int length, + const char *const str) { int stringLength = static_cast(string.length()); if (length < 0) @@ -114,7 +118,7 @@ void MessageOut::writeStringNoLog(const std::string &string, int length) } mPos += length; - DEBUGLOG("writeString: ***"); + DEBUGLOG2("writeString: ***", str); PacketCounters::incOutBytes(length); } -- cgit v1.2.3-60-g2f50