From bef8e360e5e40ee4e8648a5c56b2fae3fefb1c0a Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 30 Aug 2010 23:06:15 +0300 Subject: better logging --- init.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'init.cpp') diff --git a/init.cpp b/init.cpp index 88af0d3..59434a5 100644 --- a/init.cpp +++ b/init.cpp @@ -31,7 +31,7 @@ extern char *date(); MM_INTERFACE mmi = {0}; UTF8_INTERFACE utfi = {0}; XML_API xi = {0}; -fstream debuglog; +logtofile debuglog; #define MIID_GPG { 0x4227c050, 0x8d97, 0x48d2, { 0x91, 0xec, 0x6a, 0x95, 0x2b, 0x3d, 0xab, 0x94 } } @@ -87,13 +87,8 @@ void init_vars() outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", _T("")); outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", _T("")); bDebugLog = DBGetContactSettingByte(NULL, szGPGModuleName, "bDebugLog", 0); - bJabberAPI = DBGetContactSettingByte(NULL, szGPGModuleName, "bJabberAPI", 1); - 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); - } + debuglog.init(); + bJabberAPI = DBGetContactSettingByte(NULL, szGPGModuleName, "bJabberAPI", bIsMiranda09?1:0); } extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) @@ -236,7 +231,5 @@ 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