diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-11 14:01:25 +0000 |
commit | 773421e8ba17637d994088c393d406226b516a30 (patch) | |
tree | 130c0bf529e30f493ae4f2abbe1230d31fecdeed /protocols/Tlen/src/tlen_util.cpp | |
parent | 3fc8b6f686262e8a595fc10b2bd947526ca77bdc (diff) |
- m_hNetlibUser moved to PROTO_INTERFACE;
- unified protocol loggers
git-svn-id: http://svn.miranda-ng.org/main/trunk@6435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/tlen_util.cpp')
-rw-r--r-- | protocols/Tlen/src/tlen_util.cpp | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/protocols/Tlen/src/tlen_util.cpp b/protocols/Tlen/src/tlen_util.cpp index 6f13a7dd99..5ac920336e 100644 --- a/protocols/Tlen/src/tlen_util.cpp +++ b/protocols/Tlen/src/tlen_util.cpp @@ -49,55 +49,6 @@ unsigned int TlenSerialNext(TlenProtocol *proto) return ret;
}
-
-void TlenLog(TlenProtocol *proto, const char *fmt, ...)
-{
-#ifdef ENABLE_LOGGING
- char *str;
- va_list vararg;
- int strsize;
- char *text;
- char *p, *q;
- int extra;
-
- va_start(vararg, fmt);
- str = (char *) mir_alloc(strsize=2048);
- while (mir_vsnprintf(str, strsize, fmt, vararg) == -1)
- str = (char *) mir_realloc(str, strsize+=2048);
- va_end(vararg);
-
- extra = 0;
- for (p=str; *p != '\0'; p++)
- if (*p == '\n' || *p == '\r')
- extra++;
- size_t size = strlen("TLEN") + 2 + strlen(str) + 2 + extra;
- text = (char *) mir_alloc(size);
- mir_snprintf(text, size, "[%s]", "TLEN");
- for (p=str,q=text+strlen(text); *p != '\0'; p++,q++) {
- if (*p == '\r') {
- *q = '\\';
- *(q+1) = 'r';
- q++;
- }
- else if (*p == '\n') {
- *q = '\\';
- *(q+1) = 'n';
- q++;
- }
- else
- *q = *p;
- }
- *q = '\n';
- *(q+1) = '\0';
- if (proto->hNetlibUser != NULL) {
- CallService(MS_NETLIB_LOG, (WPARAM) proto->hNetlibUser, (LPARAM) text);
- }
- //OutputDebugString(text);
- mir_free(text);
- mir_free(str);
-#endif
-}
-
// Caution: DO NOT use TlenSend() to send binary (non-string) data
int TlenSend(TlenProtocol *proto, const char *fmt, ...)
@@ -118,7 +69,7 @@ int TlenSend(TlenProtocol *proto, const char *fmt, ...) }
va_end(vararg);
- TlenLog(proto, "SEND:%s", str);
+ proto->debugLogA("SEND:%s", str);
size = (int)strlen(str);
if (proto->threadData != NULL) {
if (proto->threadData->useAES) {
|