summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_log.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-07-13 07:39:26 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-07-13 07:39:26 +0000
commit2ab468f0ac05d1f257fbf8aa6add9512eabbcc20 (patch)
tree7eb6482089b07994ae77d264e120f3e7772c2fd6 /plugins/Clist_modern/src/modern_log.cpp
parentccb4003b6178f4c195350ae29896fdd442412af4 (diff)
Clist_modern: changed folder structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@939 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_log.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_log.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/plugins/Clist_modern/src/modern_log.cpp b/plugins/Clist_modern/src/modern_log.cpp
new file mode 100644
index 0000000000..af2b9c9a68
--- /dev/null
+++ b/plugins/Clist_modern/src/modern_log.cpp
@@ -0,0 +1,46 @@
+#include "hdr/modern_commonheaders.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+
+void Log(const char *file,int line,const char *fmt,...)
+{
+
+
+ va_list vararg;
+ const char *file_tmp;
+ char str[1024];
+ char buf[1024];
+
+ file_tmp = strrchr(file, '\\');
+ if (file_tmp == NULL)
+ file_tmp = file;
+ else
+ file_tmp++;
+
+ va_start(vararg,fmt);
+ mir_vsnprintf(str,SIZEOF(str),fmt,vararg);
+ va_end(vararg);
+ {
+ char * tmp = str;
+ while(*tmp != '\0')
+ {
+ if (*tmp == '\n') *tmp = ' ';
+ tmp++;
+ }
+ }
+ mir_snprintf(buf,SIZEOF(buf),"clist_modern:[%u - %u]: %s \t\t(%s Ln %d)\n",GetCurrentThreadId(),GetTickCount(),str,file_tmp,line);
+#ifdef _FILELOG_
+ {
+ FILE *fp;
+ fp = fopen(_FILELOG_,"at");
+ fprintf(fp,buf);
+ fclose(fp);
+ }
+#else
+ OutputDebugStringA(buf);
+#endif
+}
+