From 5d0121f526c8dde41fb87c15a1e2556c8bcb62ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 20 May 2021 15:18:17 +0300 Subject: CurrencyRates: - std::wstring replaced with CMStringW wherever possible; - std::wostringstream totally removed; - boost::json replaced with Miranda's own parser; - %d modifier added to visualize rate delta; - version bump --- protocols/CurrencyRates/src/Log.cpp | 41 ------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 protocols/CurrencyRates/src/Log.cpp (limited to 'protocols/CurrencyRates/src/Log.cpp') diff --git a/protocols/CurrencyRates/src/Log.cpp b/protocols/CurrencyRates/src/Log.cpp deleted file mode 100644 index e0a4141a49..0000000000 --- a/protocols/CurrencyRates/src/Log.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "StdAfx.h" - -namespace -{ - mir_cs g_Mutex; - - std::wstring get_log_file_name() - { - return CreateFilePath(L"CurrencyRates.log"); - } - - bool is_log_enabled() - { -#ifdef _DEBUG - return true; -#else - return (1 == g_plugin.getByte(DB_STR_ENABLE_LOG, false)); -#endif - } - - void do_log(const std::wstring& rsFileName, const std::wstring& rsMsg) - { - mir_cslock lck(g_Mutex); - std::wofstream file(rsFileName.c_str(), std::ios::ate | std::ios::app); - if (file.good()) - { - wchar_t szTime[20]; - _tstrtime_s(szTime); - file << szTime << L" ================================>\n" << rsMsg << L"\n\n"; - } - } -} - -void LogIt(const std::wstring& rsMsg) -{ - if (is_log_enabled()) - { - std::wstring sFileName = get_log_file_name(); - do_log(sFileName, rsMsg); - } -} -- cgit v1.2.3