diff --git a/win-linux/extras/online-installer/src/mainwindow.cpp b/win-linux/extras/online-installer/src/mainwindow.cpp index 7a956c94c..0de45d181 100644 --- a/win-linux/extras/online-installer/src/mainwindow.cpp +++ b/win-linux/extras/online-installer/src/mainwindow.cpp @@ -827,6 +827,7 @@ CDownloader* MainWindow::startDownload(const std::wstring &install_type, const s { wstring appcast_url = NS_Utils::cmdArgContains(_T("--appcast-dev-channel")) ? _T(URL_INSTALL_DEV) : _T(URL_INSTALL); wstring tmp_path = NS_File::toNativeSeparators(NS_File::generateTmpFileName(L".json")); + NS_Logger::WriteLog(_T("\nAppcast URL:\n") + appcast_url); CDownloader *dnl = new CDownloader(); dnl->onComplete([=](ulong error) { if (error == ERROR_SUCCESS) { @@ -846,10 +847,10 @@ CDownloader* MainWindow::startDownload(const std::wstring &install_type, const s JsonObject package_type = win.value(install_type).toObject(); tstring url = package_type.value(_T("url")).toTString(); tstring url2 = package_type.value(_T("url2")).toTString(); - NS_Logger::WriteLog(_T("Primary package URL: ") + url + _T("\nSecondary package URL: ") + url2); + NS_Logger::WriteLog(_T("\nPrimary package URL:\n") + url + _T("\nSecondary package URL:\n") + url2); if ((url.empty() || !dnl->isUrlAccessible(url)) && !url2.empty()) url = url2; - + NS_Logger::WriteLog(_T("\nDownload from URL:\n") + url); // tstring hash = package_type.value(_T("md5")).toTString(); // std::transform(hash.begin(), hash.end(), hash.begin(), ::tolower); NS_File::removeFile(tmp_path); diff --git a/win-linux/extras/online-installer/src/translator.cpp b/win-linux/extras/online-installer/src/translator.cpp index bb4f94aec..4915a2699 100644 --- a/win-linux/extras/online-installer/src/translator.cpp +++ b/win-linux/extras/online-installer/src/translator.cpp @@ -28,7 +28,7 @@ bool isValidLocaleCharacter(wchar_t c) wstring getPrimaryLang(const wstring &lang, bool withScript = false) { if (lang.empty()) { - NS_Logger::WriteLog(_T("An error occurred: ") + wstring(_T(__FUNCTION__))); + NS_Logger::WriteLog(_T("An error occurred:\n") + wstring(_T(__FUNCTION__))); return L"en"; } std::wistringstream iss(lang); @@ -40,7 +40,7 @@ wstring getPrimaryLang(const wstring &lang, bool withScript = false) std::getline(iss, script, L'_'); return (script.length() == 4) ? primlang + L"_" + script : primlang; } - NS_Logger::WriteLog(_T("An error occurred: ") + wstring(_T(__FUNCTION__))); + NS_Logger::WriteLog(_T("An error occurred:\n") + wstring(_T(__FUNCTION__))); return L"en"; } @@ -63,7 +63,7 @@ Translator::Translator(unsigned long langId, int resourceId) } else NS_Logger::WriteLog(ADVANCED_ERROR_MESSAGE); - NS_Logger::WriteLog(_T("Current locale: ") + langName); + NS_Logger::WriteLog(_T("\nCurrent locale:\n") + langName); HMODULE hInst = GetModuleHandle(NULL); if (HRSRC hRes = FindResource(hInst, MAKEINTRESOURCE(resourceId), RT_RCDATA)) { @@ -86,7 +86,7 @@ Translator::Translator(unsigned long langId, int resourceId) if (!translations.empty()) { parseTranslations(); if (!is_translations_valid) - NS_Logger::WriteLog(_T("Cannot parse translations, error in string: ") + error_substr + L" <---"); + NS_Logger::WriteLog(_T("Cannot parse translations, error in string:\n") + error_substr + L" <---"); } else NS_Logger::WriteLog(_T("Error: translations is empty.")); } diff --git a/win-linux/extras/online-installer/src/utils.cpp b/win-linux/extras/online-installer/src/utils.cpp index dab5b3ffe..83d00294e 100644 --- a/win-linux/extras/online-installer/src/utils.cpp +++ b/win-linux/extras/online-installer/src/utils.cpp @@ -365,7 +365,7 @@ namespace NS_File { std::wifstream file(filePath.c_str(), std::ios_base::in); if (!file.is_open()) { - NS_Logger::WriteLog(L"An error occurred while opening: " + filePath); + NS_Logger::WriteLog(L"An error occurred while opening:\n" + filePath); return false; } wstring line; diff --git a/win-linux/extras/online-installer/src/utils.h b/win-linux/extras/online-installer/src/utils.h index 5187b81d0..672250a86 100644 --- a/win-linux/extras/online-installer/src/utils.h +++ b/win-linux/extras/online-installer/src/utils.h @@ -43,7 +43,7 @@ using std::to_wstring; using std::list; #define ERROR_LAUNCH 0x20000000 -#define DEFAULT_ERROR_MESSAGE _T("An error occurred: ") + \ +#define DEFAULT_ERROR_MESSAGE _T("An error occurred:\n") + \ wstring(_T(__FUNCTION__)) + _T(" Line: ") + to_wstring(__LINE__) #define ADVANCED_ERROR_MESSAGE DEFAULT_ERROR_MESSAGE + \ _T(" ") + NS_Utils::GetLastErrorAsString()