add debug param to reduce logs

This commit is contained in:
Shawn Chain 2018-10-07 00:47:15 +08:00
parent 1e933b4120
commit e3facce658
5 changed files with 31 additions and 13 deletions

View file

@ -80,7 +80,13 @@ void CLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogReco
default: letter = wxT("U"); break;
}
struct tm* tm = ::gmtime(&info.timestamp);
bool utc = false;
struct tm* tm;
if (utc){
tm = ::gmtime(&info.timestamp);
}else{
tm = ::localtime(&info.timestamp);
}
wxString message;
message.Printf(wxT("%s: %04d-%02d-%02d %02d:%02d:%02d: %s\n"), letter.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, msg.c_str());

View file

@ -29,6 +29,7 @@ wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL)
{
#ifdef XLX_USE_WGET
wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_"));
wxLogMessage(_T("Downloading XLX host file..."));
wxString commandLine = _T("wget -q -O ") + xlxHostsFileName + _T(" ") + xlxHostsFileURL;
bool execResult = wxShell(commandLine);