Changes: logging messages update

pull/1/head
Alexey Shilov 15 years ago
parent e1a75a7e27
commit a6b7a681d3

@ -88,7 +88,7 @@ void Booster::run()
Connection::closeAllSockets(); Connection::closeAllSockets();
} }
Logger::logInfo("invoking '%s' ", m_app.fileName().c_str()); Logger::logInfo("Booster: invoking '%s' ", m_app.fileName().c_str());
int ret_val = launchProcess(); int ret_val = launchProcess();
if (m_conn->isReportAppExitStatusNeeded()) if (m_conn->isReportAppExitStatusNeeded())
@ -101,7 +101,7 @@ void Booster::run()
} }
else else
{ {
Logger::logError("nothing to invoke\n"); Logger::logError("Booster: nothing to invoke\n");
} }
} }
@ -130,7 +130,7 @@ void Booster::renameProcess(int parentArgc, char** parentArgv)
} }
const char* newProcessName = m_app.appName().c_str(); const char* newProcessName = m_app.appName().c_str();
Logger::logNotice("set new name for process: %s", newProcessName); Logger::logNotice("Booster: set new name for process: %s", newProcessName);
// This code copies all the new arguments to the space reserved // This code copies all the new arguments to the space reserved
// in the old argv array. If an argument won't fit then the algorithm // in the old argv array. If an argument won't fit then the algorithm
@ -161,7 +161,7 @@ void Booster::renameProcess(int parentArgc, char** parentArgv)
// Set the process name using prctl, killall and top use it // Set the process name using prctl, killall and top use it
if ( prctl(PR_SET_NAME, basename(newProcessName)) == -1 ) if ( prctl(PR_SET_NAME, basename(newProcessName)) == -1 )
Logger::logError("on set new process name: %s ", strerror(errno)); Logger::logError("Booster: on set new process name: %s ", strerror(errno));
setenv("_", newProcessName, true); setenv("_", newProcessName, true);
} }
@ -198,7 +198,7 @@ int Booster::launchProcess()
chdir(pwd); chdir(pwd);
} }
Logger::logNotice("launching process: '%s' ", m_app.fileName().c_str()); Logger::logNotice("Booster: launching process: '%s' ", m_app.fileName().c_str());
// Close logger // Close logger
Logger::closeLog(); Logger::closeLog();
@ -220,7 +220,7 @@ void* Booster::loadMain()
if (err < 0) if (err < 0)
{ {
// Credential setup has failed, abort. // Credential setup has failed, abort.
Logger::logErrorAndDie(EXIT_FAILURE, "Failed to setup credentials for launching application: %d\n", err); Logger::logErrorAndDie(EXIT_FAILURE, "Booster: Failed to setup credentials for launching application: %d\n", err);
} }
#endif #endif
@ -228,7 +228,7 @@ void* Booster::loadMain()
void * module = dlopen(m_app.fileName().c_str(), RTLD_LAZY | RTLD_GLOBAL); void * module = dlopen(m_app.fileName().c_str(), RTLD_LAZY | RTLD_GLOBAL);
if (!module) if (!module)
Logger::logErrorAndDie(EXIT_FAILURE, "loading invoked application: '%s'\n", dlerror()); Logger::logErrorAndDie(EXIT_FAILURE, "Booster: loading invoked application: '%s'\n", dlerror());
// Find out the address for symbol "main". // Find out the address for symbol "main".
dlerror(); dlerror();
@ -236,7 +236,7 @@ void* Booster::loadMain()
const char * error_s = dlerror(); const char * error_s = dlerror();
if (error_s != NULL) if (error_s != NULL)
Logger::logErrorAndDie(EXIT_FAILURE, "loading symbol 'main': '%s'\n", error_s); Logger::logErrorAndDie(EXIT_FAILURE, "Booster: loading symbol 'main': '%s'\n", error_s);
return module; return module;
} }

@ -38,7 +38,7 @@ public:
static Booster * create(char type); static Booster * create(char type);
/*! Set current process ID globally to the given booster type /*! Set current process ID globally to the given booster type
* so that we now which booster to restart if on exits. * so that we know which booster to restart if on exits.
*/ */
static void setProcessIdToBooster(char type, pid_t pid); static void setProcessIdToBooster(char type, pid_t pid);

@ -194,7 +194,7 @@ bool Connection::sendStr(const char * str)
uint32_t size = strlen(str) + 1; uint32_t size = strlen(str) + 1;
sendMsg(size); sendMsg(size);
Logger::logInfo("%s: '%s'", __FUNCTION__, str); Logger::logInfo("Connection: %s: '%s'", __FUNCTION__, str);
// Send the string. // Send the string.
return write(m_fd, str, size) != -1; return write(m_fd, str, size) != -1;
@ -404,7 +404,7 @@ bool Connection::receiveEnv()
{ {
if (putenv_wrapper(const_cast<char *>(var)) != 0) if (putenv_wrapper(const_cast<char *>(var)) != 0)
{ {
Logger::logWarning("putenv failed"); Logger::logWarning("Connection: putenv failed");
} }
} }
else else
@ -476,7 +476,7 @@ bool Connection::receiveIO()
bool Connection::receiveActions() bool Connection::receiveActions()
{ {
Logger::logInfo("enter: %s", __FUNCTION__); Logger::logInfo("Connection: enter: %s", __FUNCTION__);
while (1) while (1)
{ {

Loading…
Cancel
Save