Changes: NB#274400 (fixes logging)

RevBy: Pertti Kellomaki
pull/1/head
Dmitry Rozenshtein 14 years ago committed by Alexey Shilov
parent a088e783fd
commit f7158152cb

@ -18,8 +18,6 @@ EventHandler::EventHandler(Booster* parent, EventHandlerType type) : m_item(0),
void EventHandler::runEventLoop()
{
Logger::logError(" EventHandler::runEventLoop() ");
if (m_type == MEventHandler)
{
// Exit from event loop when invoker is ready to connect
@ -107,8 +105,6 @@ void EventHandler::notifyThemeChange()
void EventHandler::hupSignalHandler(int)
{
Logger::logError(" EventHandler::hupSignalHandler(int) ");
char a = 1;
::write(m_sighupFd[0], &a, sizeof(a));
}

@ -60,7 +60,6 @@ namespace
}
#endif // HAVE_CREDS
#include <sys/syslog.h>
#include "coverage.h"
static const int FALLBACK_GID = 126;
@ -144,8 +143,6 @@ void Booster::initialize(int initialArgc, char ** initialArgv, int newBoosterLau
if (!pluginEntry->activateExistingInstanceFunc(m_appData->appName().c_str()))
{
Logger::logWarning("Booster: Can't activate existing instance of the application!");
//since logger is disabled in Booster writing directly to syslog
syslog(LOG_WARNING,"Booster: Can't activate existing instance of the application!");
m_connection->sendExitValue(EXIT_FAILURE);
}
else
@ -523,7 +520,6 @@ void Booster::setEnvironmentBeforeLaunch()
if (pwd) chdir(pwd);
Logger::logDebug("Booster: launching process: '%s' ", m_appData->fileName().c_str());
Logger::closeLog();
}
int Booster::launchProcess()

@ -32,7 +32,6 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/prctl.h>
#include <sys/syslog.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <glob.h>
@ -279,8 +278,6 @@ void Daemon::readFromBoosterSocket(int fd)
}
else
{
// Since Logger is not working in boosters log directly to syslog
syslog(LOG_ERR,"Daemon: Nothing read from the socket\n");
Logger::logError("Daemon: Nothing read from the socket\n");
// Critical error communicating with booster. Exiting applauncherd.
_exit(EXIT_FAILURE);
@ -381,8 +378,6 @@ void Daemon::loadBoosterPlugins()
void Daemon::forkBooster(char type, int sleepTime)
{
if (!BoosterPluginRegistry::pluginEntry(type)) {
// Since Logger is not working in boosters log directly to syslog
syslog(LOG_ERR,"Daemon: Unknown booster type '%c'\n",type);
Logger::logError("Daemon: Unknown booster type '%c'\n",type);
// Critical error unknown booster type. Exiting applauncherd.
_exit(EXIT_FAILURE);

@ -31,6 +31,10 @@ bool Logger::m_debugMode = false;
void Logger::openLog(const char * progName)
{
if (Logger::m_isOpened)
{
Logger::closeLog();
}
openlog(progName, LOG_PID, LOG_DAEMON);
Logger::m_isOpened = true;
}
@ -54,11 +58,12 @@ void Logger::writeLog(const int priority, const char * format, va_list ap)
printf("\n");
}
if (Logger::m_isOpened)
// Print to syslog
if (!Logger::m_isOpened)
{
// Print to syslog
vsyslog(priority, format, ap);
Logger::openLog(); //open log with default name
}
vsyslog(priority, format, ap);
}
void Logger::logDebug(const char * format, ...)

@ -35,7 +35,7 @@ public:
* \brief Open the log
* \param progName Program name as it will be seen in the log.
*/
static void openLog(const char * progName);
static void openLog(const char * progName = PROG_NAME_LAUNCHER);
/*!
* \brief Close the log

Loading…
Cancel
Save