summaryrefslogtreecommitdiff
path: root/src/net/messageout.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-31 14:11:23 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-31 14:11:23 +0300
commit544de86739a85792be7e6883968b2af8590d0711 (patch)
treeecdbe7aa2224e2aca5f3124443c417457bc94775 /src/net/messageout.cpp
parenta63248380554067d4291c653b4ba82db36fbc821 (diff)
downloadplus-544de86739a85792be7e6883968b2af8590d0711.tar.gz
plus-544de86739a85792be7e6883968b2af8590d0711.tar.bz2
plus-544de86739a85792be7e6883968b2af8590d0711.tar.xz
plus-544de86739a85792be7e6883968b2af8590d0711.zip
Add comments for outbound packet fields in debug log.
Diffstat (limited to 'src/net/messageout.cpp')
-rw-r--r--src/net/messageout.cpp16
1 files changed, 10 insertions, 6 deletions
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<int>(value)));
+ DEBUGLOG2("writeInt8: " + toStringPrint(static_cast<int>(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<int>(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<int>(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);
}