WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
else
settings = newSettings;
+ WriteServLog.SetLogFileName(settings.GetLogFileName());
traffCnt.Reload();
manager.reload(settings);
}
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
void SetSettings(const MODULE_SETTINGS &) {}
int ParseSettings() { return 0; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning();
void SetSettings(const MODULE_SETTINGS & s);
int ParseSettings();
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
int ParseSettings() { return 0; }
bool IsRunning();
const std::string & GetStrError() const;
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return runningTCP || runningUDP; }
const std::string & GetStrError() const { return errorStr; }
std::string GetVersion() const { return VERSION; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
void SetSettings(const MODULE_SETTINGS & s) { settings = s; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
void SetSettings(const MODULE_SETTINGS & s) { settings = s; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
int ParseSettings() { return 0; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
int ParseSettings() { return 0; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
void SetSettings(const MODULE_SETTINGS & s) { settings = s; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return running && !stopped; }
const std::string & GetStrError() const { return errorStr; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
const std::string & GetStrError() const { return errorStr; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning();
const std::string & GetStrError() const { return errorStr; }
int Start();
int Stop();
- int Reload(const MODULE_SETTINGS & ms) { return 0; }
+ int Reload(const MODULE_SETTINGS & /*ms*/) { return 0; }
bool IsRunning() { return isRunning; }
const std::string & GetStrError() const { return errorStr; }
return 0;
}
//-----------------------------------------------------------------------------
-int REMOTE_SCRIPT::Reload(const MODULE_SETTINGS & ms)
+int REMOTE_SCRIPT::Reload(const MODULE_SETTINGS & /*ms*/)
{
NRMapParser nrMapParser;
return 0;
}
-int SMUX::Reload(const MODULE_SETTINGS & ms)
+int SMUX::Reload(const MODULE_SETTINGS & /*ms*/)
{
if (Stop())
return -1;
mutable pthread_mutex_t mutex;
};
//-----------------------------------------------------------------------------
-class PLUGIN_LOGGER : private STG_LOGGER
+class PLUGIN_LOGGER
{
-friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName);
+friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER& logger, const std::string& pluginName);
public:
- PLUGIN_LOGGER(const PLUGIN_LOGGER & rhs);
- void operator()(const char * fmt, ...) const;
- void operator()(const std::string & line) const;
+ PLUGIN_LOGGER(const PLUGIN_LOGGER& rhs) : m_parent(rhs.m_parent), m_pluginName(rhs.m_pluginName) {}
+ void operator()(const char* fmt, ...) const;
+ void operator()(const std::string& line) const;
private:
PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn);
- std::string pluginName;
+ const STG_LOGGER& m_parent;
+ std::string m_pluginName;
};
PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName);
}
}
//-----------------------------------------------------------------------------
-PLUGIN_LOGGER::PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn)
- : STG_LOGGER(),
- pluginName(pn)
+PLUGIN_LOGGER::PLUGIN_LOGGER(const STG_LOGGER& logger, const std::string& pn)
+ : m_parent(logger),
+ m_pluginName(pn)
{
- SetLogFileName(logger.fileName);
-}
-//-----------------------------------------------------------------------------
-PLUGIN_LOGGER::PLUGIN_LOGGER(const PLUGIN_LOGGER & rhs)
- : STG_LOGGER(),
- pluginName(rhs.pluginName)
-{
- SetLogFileName(fileName);
}
//-----------------------------------------------------------------------------
void PLUGIN_LOGGER::operator()(const char * fmt, ...) const
vsnprintf(buff, sizeof(buff), fmt, vl);
va_end(vl);
-STG_LOGGER::operator()("[%s] %s", pluginName.c_str(), buff);
+m_parent("[%s] %s", m_pluginName.c_str(), buff);
}
//-----------------------------------------------------------------------------
void PLUGIN_LOGGER::operator()(const std::string & line) const
{
-STG_LOGGER::operator()("[%s] %s", pluginName.c_str(), line.c_str());
+m_parent("[%s] %s", m_pluginName.c_str(), line.c_str());
}
//-----------------------------------------------------------------------------
PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName)