diff --git a/Common/APRSWriterThread.cpp b/Common/APRSWriterThread.cpp index 240974b..1f9bb98 100644 --- a/Common/APRSWriterThread.cpp +++ b/Common/APRSWriterThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2014,2018 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/Common/DDHandler.cpp b/Common/DDHandler.cpp index 0663450..5f85820 100644 --- a/Common/DDHandler.cpp +++ b/Common/DDHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011,2012,2013 by Jonathan Naylor G4KLX + * Copyright (C) 2011,2012,2013,2018 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,8 +22,7 @@ #include -#if !defined(WIN32) -// XXX Check these +#if defined(__linux__) #include #include #include @@ -240,7 +239,7 @@ void CDDHandler::process(CDDData& data) } } -#if !defined(WIN32) +#if defined(__linux__) unsigned int length = data.getEthernetFrame(m_buffer, BUFFER_LENGTH); ssize_t len = ::write(m_fd, (char*)m_buffer, length); @@ -255,7 +254,7 @@ CDDData* CDDHandler::read() if (m_maxRoutes == 0U) return NULL; -#if defined(WIN32) +#if !defined(WIN32) return NULL; #else // Check that the read() won't block diff --git a/Common/XLXHostsFileDownloader.cpp b/Common/XLXHostsFileDownloader.cpp index 633d9f8..aab4016 100644 --- a/Common/XLXHostsFileDownloader.cpp +++ b/Common/XLXHostsFileDownloader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013,2015 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2013,2015,2018 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,8 @@ wxString CXLXHostsFileDownloader::Download(const wxString & xlxHostsFileURL) { #ifdef XLX_USE_WGET + wxLogMessage(_T("Downloading XLX reflector list from %s"), xlxHostsFileURL.c_str()); + wxString xlxHostsFileName = wxFileName::CreateTempFileName(_T("XLX_Hosts_")); wxLogMessage(_T("Downloading XLX host file...")); wxString commandLine = _T("wget -q -O ") + xlxHostsFileName + _T(" ") + xlxHostsFileURL; diff --git a/ircDDBGateway/IRCDDBGatewayApp.cpp b/ircDDBGateway/IRCDDBGatewayApp.cpp index dc563d4..7c50b4b 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.cpp +++ b/ircDDBGateway/IRCDDBGatewayApp.cpp @@ -40,6 +40,7 @@ wxIMPLEMENT_APP(CIRCDDBGatewayApp); const wxChar* NAME_PARAM = wxT("Gateway Name"); const wxChar* NOLOGGING_SWITCH = wxT("nolog"); +const wxChar* DEBUG_SWITCH = wxT("debug"); const wxChar* GUI_SWITCH = wxT("gui"); const wxChar* LOGDIR_OPTION = wxT("logdir"); const wxChar* CONFDIR_OPTION = wxT("confdir"); @@ -50,6 +51,7 @@ CIRCDDBGatewayApp::CIRCDDBGatewayApp() : wxApp(), m_name(), m_nolog(false), +m_debug(false), m_gui(false), m_logDir(), m_confDir(), @@ -89,6 +91,14 @@ bool CIRCDDBGatewayApp::OnInit() wxLog* log = new CLogger(m_logDir, logBaseName); wxLog::SetActiveTarget(log); + + if (m_debug) { + wxLog::SetVerbose(true); + wxLog::SetLogLevel(wxLOG_Debug); + } else { + wxLog::SetVerbose(false); + wxLog::SetLogLevel(wxLOG_Message); + } } else { new wxLogNull; } @@ -174,6 +184,7 @@ int CIRCDDBGatewayApp::OnExit() void CIRCDDBGatewayApp::OnInitCmdLine(wxCmdLineParser& parser) { parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); + parser.AddSwitch(DEBUG_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddSwitch(GUI_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); @@ -188,6 +199,7 @@ bool CIRCDDBGatewayApp::OnCmdLineParsed(wxCmdLineParser& parser) return false; m_nolog = parser.Found(NOLOGGING_SWITCH); + m_debug = parser.Found(DEBUG_SWITCH); m_gui = parser.Found(GUI_SWITCH); wxString logDir; diff --git a/ircDDBGateway/IRCDDBGatewayApp.h b/ircDDBGateway/IRCDDBGatewayApp.h index 3d11ba6..2bf5a3d 100644 --- a/ircDDBGateway/IRCDDBGatewayApp.h +++ b/ircDDBGateway/IRCDDBGatewayApp.h @@ -54,6 +54,7 @@ public: private: wxString m_name; bool m_nolog; + bool m_debug; bool m_gui; wxString m_logDir; wxString m_confDir; diff --git a/ircDDBGateway/IRCDDBGatewayAppD.cpp b/ircDDBGateway/IRCDDBGatewayAppD.cpp index 07d5d35..ba06b19 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.cpp +++ b/ircDDBGateway/IRCDDBGatewayAppD.cpp @@ -46,10 +46,10 @@ const wxChar* NAME_PARAM = wxT("Gateway Name"); const wxChar* NOLOGGING_SWITCH = wxT("nolog"); +const wxChar* DEBUG_SWITCH = wxT("debug"); const wxChar* LOGDIR_OPTION = wxT("logdir"); const wxChar* CONFDIR_OPTION = wxT("confdir"); const wxChar* DAEMON_SWITCH = wxT("daemon"); -const wxChar* DEBUG_SWITCH = wxT("debug"); const wxString LOG_BASE_NAME = wxT("ircDDBGateway"); @@ -70,8 +70,8 @@ int main(int argc, char** argv) wxCmdLineParser parser(argc, argv); parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); - parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddSwitch(DEBUG_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); + parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); parser.AddParam(NAME_PARAM, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); @@ -83,8 +83,8 @@ int main(int argc, char** argv) } bool nolog = parser.Found(NOLOGGING_SWITCH); + bool debug = parser.Found(DEBUG_SWITCH); bool daemon = parser.Found(DAEMON_SWITCH); - bool debug = parser.Found(DEBUG_SWITCH); wxString logDir; bool found = parser.Found(LOGDIR_OPTION, &logDir); @@ -188,10 +188,11 @@ bool CIRCDDBGatewayAppD::init() wxLog* log = new CLogger(m_logDir, logBaseName); wxLog::SetActiveTarget(log); - if (m_debug){ - wxLog::SetVerbose(); + + if (m_debug) { + wxLog::SetVerbose(true); wxLog::SetLogLevel(wxLOG_Debug); - }else{ + } else { wxLog::SetVerbose(false); wxLog::SetLogLevel(wxLOG_Message); } diff --git a/ircDDBGateway/IRCDDBGatewayAppD.h b/ircDDBGateway/IRCDDBGatewayAppD.h index d3bbff7..5fd1d40 100644 --- a/ircDDBGateway/IRCDDBGatewayAppD.h +++ b/ircDDBGateway/IRCDDBGatewayAppD.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013 by Jonathan Naylor G4KLX + * Copyright (C) 2010-2013,2018 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by