summaryrefslogtreecommitdiff
path: root/protocols/CurrencyRates/src/Log.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-05-20 15:18:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-05-20 15:18:17 +0300
commit5d0121f526c8dde41fb87c15a1e2556c8bcb62ba (patch)
tree2c80ce06f0600a897ee527fab97590b9c5c1fdac /protocols/CurrencyRates/src/Log.cpp
parent0d08ce17f07300d4851e24a7123415015849605c (diff)
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
Diffstat (limited to 'protocols/CurrencyRates/src/Log.cpp')
-rw-r--r--protocols/CurrencyRates/src/Log.cpp41
1 files changed, 0 insertions, 41 deletions
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);
- }
-}