From 45ff7b504d79072bfbd24cf12f5818ed356f94bc Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 18 Aug 2010 08:26:47 +0300 Subject: modified: gpg_wrapper.cpp modified: init.cpp modified: main.cpp modified: messages.cpp modified: new_gpg.rc modified: new_gpg.sln modified: new_gpg.vcproj modified: options.cpp modified: resource.h modified: utilities.cpp --- init.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'init.cpp') diff --git a/init.cpp b/init.cpp index 97d1db1..3351c1f 100644 --- a/init.cpp +++ b/init.cpp @@ -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 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("")); outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", _T("")); outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", _T("")); + 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; } -- cgit v1.2.3