summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/database.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-12 18:37:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-12 18:37:37 +0000
commitc48cb57ce96c52350077b6710422fb072bd9f276 (patch)
tree01ddc1a0757301716a64a1eb043a9cb9edbe4e01 /plugins/Db3x_mmap/src/database.cpp
parent744158b569eb5c888644069c03f01463bc632c34 (diff)
enchanced database logging
git-svn-id: http://svn.miranda-ng.org/main/trunk@2300 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/database.cpp')
-rw-r--r--plugins/Db3x_mmap/src/database.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp
index 5971c1c68b..c9a4793c0f 100644
--- a/plugins/Db3x_mmap/src/database.cpp
+++ b/plugins/Db3x_mmap/src/database.cpp
@@ -123,6 +123,21 @@ void CDb3Base::DatabaseCorruption(TCHAR *text)
/////////////////////////////////////////////////////////////////////////////////////////
#ifdef DBLOGGING
+char* printVariant(DBVARIANT* p)
+{
+ static char boo[1000];
+
+ switch (p->type) {
+ case DBVT_BYTE: mir_snprintf(boo, sizeof(boo), "byte: %d", p->bVal ); break;
+ case DBVT_WORD: mir_snprintf(boo, sizeof(boo), "word: %d", p->wVal ); break;
+ case DBVT_DWORD: mir_snprintf(boo, sizeof(boo), "dword: %d", p->dVal ); break;
+ case DBVT_UTF8:
+ case DBVT_ASCIIZ: mir_snprintf(boo, sizeof(boo), "string: '%s'", p->pszVal); break;
+ default: mir_snprintf(boo, sizeof(boo), "crap: %d", p->type ); break;
+ }
+ return boo;
+}
+
void DBLog(const char *file,int line,const char *fmt,...)
{
FILE *fp;