diff options
author | George Hazan <ghazan@miranda.im> | 2020-09-29 20:49:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-09-29 20:49:18 +0300 |
commit | f6ec6ec5f60a72df8c4eda5c956de66b163052a8 (patch) | |
tree | 08d6c2df84d0993b4f60ed8b1e80975fc39a9736 | |
parent | dc6689e1833c53bb0a32e224fa6f739e866df62c (diff) |
minor code cleaning
-rw-r--r-- | src/mir_app/src/netlib_log.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mir_app/src/netlib_log.cpp b/src/mir_app/src/netlib_log.cpp index 5640c34c66..d599851694 100644 --- a/src/mir_app/src/netlib_log.cpp +++ b/src/mir_app/src/netlib_log.cpp @@ -36,7 +36,7 @@ extern HANDLE hConnectionHeaderMutex; struct { HWND hwndOpts; bool toOutputDebugString, toFile, toLog; - bool showUser; + bool showUser, rotateLogs; bool dumpSent, dumpRecv, dumpProxy, dumpSsl; bool textDumps, autoDetectText; int timeFormat; @@ -64,6 +64,7 @@ static void InitLog() logOptions.textDumps = db_get_b(0, "Netlib", "TextDumps", true) != 0; logOptions.autoDetectText = db_get_b(0, "Netlib", "AutoDetectText", true) != 0; logOptions.timeFormat = db_get_b(0, "Netlib", "TimeFormat", TIMEFORMAT_HHMMSS); + logOptions.rotateLogs = db_get_b(0, "Netlib", "RotateLogs", false); logOptions.showUser = db_get_b(0, "Netlib", "ShowUser", true) != 0; logOptions.toOutputDebugString = db_get_b(0, "Netlib", "ToOutputDebugString", false) != 0; logOptions.toFile = db_get_b(0, "Netlib", "ToFile", false) != 0; @@ -89,7 +90,7 @@ static void InitLog() if (logOptions.toFile) { CMStringW wszFileName = logOptions.tszFile; - if (db_get_b(0, "Netlib", "RotateLogs", false)) { + if (logOptions.rotateLogs) { int iLogNumber = db_get_dw(0, "Netlib", "RotateId"); wszFileName.AppendFormat(L".%d", iLogNumber); db_set_dw(0, "Netlib", "RotateId", (iLogNumber + 1) % 10); @@ -137,6 +138,7 @@ public: CheckDlgButton(m_hwnd, IDC_DUMPPROXY, logOptions.dumpProxy ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(m_hwnd, IDC_DUMPSSL, logOptions.dumpSsl ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(m_hwnd, IDC_TEXTDUMPS, logOptions.textDumps ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(m_hwnd, IDC_LOGROTATE, logOptions.rotateLogs ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(m_hwnd, IDC_AUTODETECTTEXT, logOptions.autoDetectText ? BST_CHECKED : BST_UNCHECKED); for (auto &it : szTimeFormats) |