Changes: rename logNotice to logDebug, use logDebug instead of logInfo

RevBy: TrustMe
pull/1/head
Alexey Shilov 15 years ago
parent deb480881f
commit 194646aaea

@ -87,7 +87,7 @@ void Booster::initialize(int initialArgc, char ** initialArgv, int newPipeFd[2],
popPriority(); popPriority();
// Wait and read commands from the invoker // Wait and read commands from the invoker
Logger::logNotice("Booster: Wait for message from invoker"); Logger::logDebug("Booster: Wait for message from invoker");
if (!receiveDataFromInvoker(socketFd)) { if (!receiveDataFromInvoker(socketFd)) {
Logger::logErrorAndDie(EXIT_FAILURE, "Booster: Couldn't read command\n"); Logger::logErrorAndDie(EXIT_FAILURE, "Booster: Couldn't read command\n");
} }
@ -202,7 +202,7 @@ void Booster::run(SocketManager * socketManager)
} }
// Execute the binary // Execute the binary
Logger::logInfo("Booster: invoking '%s' ", m_appData->fileName().c_str()); Logger::logDebug("Booster: invoking '%s' ", m_appData->fileName().c_str());
int ret_val = launchProcess(); int ret_val = launchProcess();
// Send exit status to invoker, if needed // Send exit status to invoker, if needed
@ -324,7 +324,7 @@ int Booster::launchProcess()
const char * pwd = getenv("PWD"); const char * pwd = getenv("PWD");
if (pwd) chdir(pwd); if (pwd) chdir(pwd);
Logger::logNotice("Booster: launching process: '%s' ", m_appData->fileName().c_str()); Logger::logDebug("Booster: launching process: '%s' ", m_appData->fileName().c_str());
Logger::closeLog(); Logger::closeLog();
// Jump to main() // Jump to main()

@ -122,7 +122,7 @@ bool Connection::sendMsg(uint32_t msg)
{ {
if (!m_testMode) if (!m_testMode)
{ {
Logger::logInfo("%s: %08x", __FUNCTION__, msg); Logger::logDebug("Connection: %s: %08x", __FUNCTION__, msg);
return write(m_fd, &msg, sizeof(msg)) != -1; return write(m_fd, &msg, sizeof(msg)) != -1;
} }
else else
@ -146,7 +146,7 @@ bool Connection::recvMsg(uint32_t *msg)
} }
else else
{ {
Logger::logInfo("%s: %08x", __FUNCTION__, *msg); Logger::logDebug("Connection: %s: %08x", __FUNCTION__, *msg);
*msg = buf; *msg = buf;
} }
@ -166,7 +166,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("Connection: %s: '%s'", __FUNCTION__, str); Logger::logDebug("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;
@ -209,7 +209,7 @@ const char * Connection::recvStr()
} }
str[size - 1] = '\0'; str[size - 1] = '\0';
Logger::logInfo("%s: '%s'", __FUNCTION__, str); Logger::logDebug("Connection: %s: '%s'", __FUNCTION__, str);
return str; return str;
} }
@ -457,7 +457,7 @@ bool Connection::receiveIO()
bool Connection::receiveActions() bool Connection::receiveActions()
{ {
Logger::logInfo("Connection: enter: %s", __FUNCTION__); Logger::logDebug("Connection: enter: %s", __FUNCTION__);
while (1) while (1)
{ {

@ -134,7 +134,7 @@ void Daemon::initBoosterSockets()
BoosterPluginEntry * plugin = BoosterPluginRegistry::pluginEntry(i); BoosterPluginEntry * plugin = BoosterPluginRegistry::pluginEntry(i);
if (plugin) if (plugin)
{ {
Logger::logInfo("Daemon: initing socket: %s", plugin->socketNameFunc()); Logger::logDebug("Daemon: initing socket: %s", plugin->socketNameFunc());
m_socketManager->initSocket(plugin->socketNameFunc()); m_socketManager->initSocket(plugin->socketNameFunc());
} }
} }
@ -148,7 +148,7 @@ void Daemon::forkBoosters()
BoosterPluginEntry * plugin = BoosterPluginRegistry::pluginEntry(i); BoosterPluginEntry * plugin = BoosterPluginRegistry::pluginEntry(i);
if (plugin) if (plugin)
{ {
Logger::logInfo("Daemon: forking booster: '%c'", plugin->type); Logger::logDebug("Daemon: forking booster: '%c'", plugin->type);
forkBooster(plugin->type); forkBooster(plugin->type);
} }
} }
@ -197,7 +197,7 @@ void Daemon::run()
} }
else else
{ {
Logger::logInfo("Daemon: invoker's pid: %d \n", invokerPid); Logger::logDebug("Daemon: invoker's pid: %d \n", invokerPid);
} }
if (invokerPid != 0) if (invokerPid != 0)
@ -220,7 +220,7 @@ void Daemon::run()
} }
else else
{ {
Logger::logInfo("Daemon: respawn delay: %d \n", delay); Logger::logDebug("Daemon: respawn delay: %d \n", delay);
} }
// Fork a new booster of the given type // Fork a new booster of the given type
@ -260,7 +260,7 @@ void Daemon::loadSingleInstancePlugin()
{ {
if (m_singleInstance->validateAndRegisterPlugin(handle)) if (m_singleInstance->validateAndRegisterPlugin(handle))
{ {
Logger::logInfo("Daemon: single-instance plugin loaded.'"); Logger::logDebug("Daemon: single-instance plugin loaded.'");
} }
else else
{ {
@ -303,7 +303,7 @@ void Daemon::loadBoosterPlugins()
char newType = BoosterPluginRegistry::validateAndRegisterPlugin(handle); char newType = BoosterPluginRegistry::validateAndRegisterPlugin(handle);
if (newType) if (newType)
{ {
Logger::logInfo("Daemon: Booster of type '%c' loaded.'", newType); Logger::logDebug("Daemon: Booster of type '%c' loaded.'", newType);
} }
else else
{ {
@ -354,7 +354,7 @@ void Daemon::forkBooster(char type, int sleepTime)
if (sleepTime) if (sleepTime)
sleep(sleepTime); sleep(sleepTime);
Logger::logInfo("Daemon: Running a new Booster of type '%c'", type); Logger::logDebug("Daemon: Running a new Booster of type '%c'", type);
// Create a new booster, initialize and run it // Create a new booster, initialize and run it
Booster * booster = BoosterFactory::create(type); Booster * booster = BoosterFactory::create(type);
@ -411,15 +411,15 @@ void Daemon::reapZombies()
PidMap::iterator it = m_boosterPidToInvokerPid.find(pid); PidMap::iterator it = m_boosterPidToInvokerPid.find(pid);
if (it != m_boosterPidToInvokerPid.end()) if (it != m_boosterPidToInvokerPid.end())
{ {
Logger::logInfo("Daemon: Terminated process had a mapping to an invoker pid"); Logger::logDebug("Daemon: Terminated process had a mapping to an invoker pid");
if (WIFSIGNALED(status)) if (WIFSIGNALED(status))
{ {
int signal = WTERMSIG(status); int signal = WTERMSIG(status);
pid_t invokerPid = (*it).second; pid_t invokerPid = (*it).second;
Logger::logInfo("Daemon: Booster (pid=%d) was terminated due to signal %d\n", pid, signal); Logger::logDebug("Daemon: Booster (pid=%d) was terminated due to signal %d\n", pid, signal);
Logger::logInfo("Daemon: Killing invoker process (pid=%d) by signal %d..\n", invokerPid, signal); Logger::logDebug("Daemon: Killing invoker process (pid=%d) by signal %d..\n", invokerPid, signal);
if (kill(invokerPid, signal) != 0) if (kill(invokerPid, signal) != 0)
{ {

@ -154,8 +154,8 @@ void Logger::writeLog(const int priority, const char * format, va_list ap)
// Print type prefix to the stream // Print type prefix to the stream
switch (priority) switch (priority)
{ {
case LOG_NOTICE: case LOG_DEBUG:
m_logStream << " [NOTICE] "; m_logStream << " [DEBUG] ";
break; break;
case LOG_ERR: case LOG_ERR:
@ -183,12 +183,12 @@ void Logger::writeLog(const int priority, const char * format, va_list ap)
} }
void Logger::logNotice(const char * format, ...) void Logger::logDebug(const char * format, ...)
{ {
#ifndef DEBUG_LOGGING_DISABLED #ifndef DEBUG_LOGGING_DISABLED
va_list(ap); va_list(ap);
va_start(ap, format); va_start(ap, format);
writeLog(LOG_NOTICE, format, ap); writeLog(LOG_DEBUG, format, ap);
va_end(ap); va_end(ap);
#else #else
Q_UNUSED(format); Q_UNUSED(format);
@ -197,14 +197,10 @@ void Logger::logNotice(const char * format, ...)
void Logger::logInfo(const char * format, ...) void Logger::logInfo(const char * format, ...)
{ {
#ifndef DEBUG_LOGGING_DISABLED
va_list(ap); va_list(ap);
va_start(ap, format); va_start(ap, format);
writeLog(LOG_INFO, format, ap); writeLog(LOG_INFO, format, ap);
va_end(ap); va_end(ap);
#else
Q_UNUSED(format);
#endif
} }
void Logger::logWarning(const char * format, ...) void Logger::logWarning(const char * format, ...)

@ -52,7 +52,7 @@ public:
* sequence of additional arguments, each containing one value to be inserted * sequence of additional arguments, each containing one value to be inserted
* in the format parameter, if any. * in the format parameter, if any.
*/ */
static void logNotice(const char * format, ...); static void logDebug(const char * format, ...);
/*! /*!

@ -48,7 +48,7 @@ Q_DECL_EXPORT int main(int argc, char * argv[])
// Open the log // Open the log
Logger::openLog(PROG_NAME_LAUNCHER); Logger::openLog(PROG_NAME_LAUNCHER);
Logger::logNotice("%s starting..", PROG_NAME_LAUNCHER); Logger::logDebug("%s starting..", PROG_NAME_LAUNCHER);
// Check that an instance of launcher is not already running // Check that an instance of launcher is not already running
if(!Daemon::lock()) if(!Daemon::lock())

@ -31,7 +31,7 @@ void SocketManager::initSocket(const string & socketId)
// exist for that id / path. // exist for that id / path.
if (m_socketHash.find(socketId) == m_socketHash.end()) if (m_socketHash.find(socketId) == m_socketHash.end())
{ {
Logger::logInfo("Initing socket at '%s'..", socketId.c_str()); Logger::logDebug("SoketManager: Initing socket at '%s'..", socketId.c_str());
// Create a new local socket // Create a new local socket
int socketFd = socket(PF_UNIX, SOCK_STREAM, 0); int socketFd = socket(PF_UNIX, SOCK_STREAM, 0);

Loading…
Cancel
Save