int StartScriptExecuter(char *, int msgKey, int * msgID)
#endif
{
-STG_LOGGER & WriteServLog = GetStgLogger();
+auto & WriteServLog = STG::Logger::get();
if (*msgID == -11) // If msgID == -11 - first call. Create queue
{
//-----------------------------------------------------------------------------
void StopScriptExecuter(int msgID)
{
-STG_LOGGER & WriteServLog = GetStgLogger();
+auto & WriteServLog = STG::Logger::get();
for (int i = 0; i < 5; ++i)
{
if (cfg->Error())
{
- STG_LOGGER & WriteServLog = GetStgLogger();
- WriteServLog.SetLogFileName("/var/log/rscriptd.log");
+ auto & WriteServLog = STG::Logger::get();
+ WriteServLog.setFileName("/var/log/rscriptd.log");
WriteServLog("Error reading config file!");
delete cfg;
return EXIT_FAILURE;
if (ForkAndWait(confDir) < 0)
{
- STG_LOGGER & WriteServLog = GetStgLogger();
+ auto & WriteServLog = STG::Logger::get();
WriteServLog("Fork error!");
delete cfg;
return EXIT_FAILURE;
}
-STG_LOGGER & WriteServLog = GetStgLogger();
+auto & WriteServLog = STG::Logger::get();
PIDFile pidFile("/var/run/rscriptd.pid");
-WriteServLog.SetLogFileName(logFileName);
+WriteServLog.setFileName(logFileName);
WriteServLog("rscriptd v. %s", SERVER_VERSION);
for (int i = 0; i < execNum; i++)
int ret = StartScriptExecuter(argv[0], execMsgKey, &msgID);
if (ret < 0)
{
- STG_LOGGER & WriteServLog = GetStgLogger();
- WriteServLog("Start Script Executer error!");
+ STG::Logger::get()("Start Script Executer error!");
delete cfg;
return EXIT_FAILURE;
}