diff options
Diffstat (limited to 'init.cpp')
-rw-r--r-- | init.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -17,7 +17,7 @@ #include "commonheaders.h"
//global variables
-bool bAppendTags = false;
+bool bAppendTags = false, bDebugLog = false;
TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
list <JabberAccount*> Accounts;
@@ -30,6 +30,7 @@ extern char *date(); MM_INTERFACE mmi = {0};
UTF8_INTERFACE utfi = {0};
XML_API xi = {0};
+fstream debuglog;
#define MIID_GPG { 0x4227c050, 0x8d97, 0x48d2, { 0x91, 0xec, 0x6a, 0x95, 0x2b, 0x3d, 0xab, 0x94 } }
@@ -84,6 +85,13 @@ void init_vars() inclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", _T("</GnuPGdec>"));
outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", _T("<GPGenc>"));
outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", _T("</GnuPgenc>"));
+ bDebugLog = DBGetContactSettingByte(NULL, szGPGModuleName, "bDebugLog", 0);
+ if(bDebugLog)
+ {
+ TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", _T("C:\\gpglog.txt"));
+ debuglog.open(tmp, std::ios::app |std::ios::ate |std::ios::binary);
+// mir_free(tmp);
+ }
}
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
@@ -187,5 +195,7 @@ extern "C" int __declspec(dllexport) Unload(void) mir_free(outclosetag);
if(password)
delete [] password;
+ if(debuglog.is_open())
+ debuglog.close();
return 0;
}
|