From 5b304799fb995811a8686bab9e877cb235c21a2e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 7 Feb 2015 19:36:41 +0000 Subject: correct log format git-svn-id: http://svn.miranda-ng.org/main/trunk@12044 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp | 8 ++++---- protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.h | 8 ++++---- protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp | 2 +- protocols/WhatsApp/src/WhatsAPI++/ISocketConnection.h | 2 +- protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++') diff --git a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp index 851d4599da..daf17108a8 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp @@ -260,7 +260,7 @@ void BinTreeNodeReader::fillArray(std::vector& buff, int len, Byt count += in->read(buff, count, len - count); } -void BinTreeNodeReader::fillArray(std::vector& buff, int len, ISocketConnection* in) +void BinTreeNodeReader::fillArray(std::vector& buff, int len, ISocketConnection *in) { int count = 0; while (count < len) @@ -326,19 +326,19 @@ void BinTreeNodeReader::streamStart() delete attributes; } -int BinTreeNodeReader::readInt8(ISocketConnection* in) +int BinTreeNodeReader::readInt8(ISocketConnection *in) { return in->read(); } -int BinTreeNodeReader::readInt16(ISocketConnection* in) +int BinTreeNodeReader::readInt16(ISocketConnection *in) { unsigned char data[2]; in->read(data, 2); return (int(data[0]) << 8) + int(data[1]); } -int BinTreeNodeReader::readInt24(ISocketConnection* in) +int BinTreeNodeReader::readInt24(ISocketConnection *in) { unsigned char data[3]; in->read(data, 3); diff --git a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.h b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.h index eb8761ce12..7a2d43454d 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.h +++ b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.h @@ -48,17 +48,17 @@ private: ReadData* readString(); ReadData* readString(int token); static void fillArray(std::vector& buff, int len, ByteArrayInputStream* in); - static void fillArray(std::vector& buff, int len, ISocketConnection* in); + static void fillArray(std::vector& buff, int len, ISocketConnection *in); std::string* objectAsString(ReadData* o); std::string* readStringAsString(); std::string* readStringAsString(int token); void getTopLevelStream(); static int readInt8(ByteArrayInputStream* in); - static int readInt8(ISocketConnection* in); + static int readInt8(ISocketConnection *in); static int readInt16(ByteArrayInputStream* in); - static int readInt16(ISocketConnection* in); + static int readInt16(ISocketConnection *in); static int readInt24(ByteArrayInputStream* in); - static int readInt24(ISocketConnection* in); + static int readInt24(ISocketConnection *in); public: diff --git a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp index e527e2c25b..4d55e536a0 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp @@ -267,7 +267,7 @@ void BinTreeNodeWriter::write(const ProtocolTreeNode &node, bool needsFlush) if (bSecure) { string tmp = node.toString(); - this->realOut->log(tmp.c_str()); + this->realOut->log("XML written:\n", tmp.c_str()); } if (node.tag.empty()) diff --git a/protocols/WhatsApp/src/WhatsAPI++/ISocketConnection.h b/protocols/WhatsApp/src/WhatsAPI++/ISocketConnection.h index 0661b23945..1aa9d92a49 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/ISocketConnection.h +++ b/protocols/WhatsApp/src/WhatsAPI++/ISocketConnection.h @@ -20,7 +20,7 @@ public: virtual int waitForRead() = 0; virtual void forceShutdown() = 0; - virtual void log(const char *str) = 0; + virtual void log(const char *prefix, const char *str) = 0; }; #endif /* ISOCKETCONNECTION_H_ */ diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index be44413c52..e1e983cad0 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -91,7 +91,7 @@ void WAConnection::logData(const char *format, ...) va_start(args, format); char tmp[4000]; vsprintf_s(tmp, format, args); - rawConn->log(tmp); + rawConn->log(">> ", tmp); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -196,7 +196,7 @@ bool WAConnection::read() throw(WAException) return false; string tmp = node->toString(); - rawConn->log(tmp.c_str()); + rawConn->log("XML received\n", tmp.c_str()); if (ProtocolTreeNode::tagEquals(node, "iq")) parseIq(node); -- cgit v1.2.3