summaryrefslogtreecommitdiffstats
path: root/src/Daemon
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-06 17:51:17 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-06 17:51:17 +0100
commit1202706839ec42299e8794750cec66dfa7db0206 (patch)
tree328fec88403061afca8a71c74bc78e1b3dd96f34 /src/Daemon
parentb1336faa48bee2cdb7ef0486a5a4faa5c74f4fa7 (diff)
downloadabrt-1202706839ec42299e8794750cec66dfa7db0206.tar.gz
abrt-1202706839ec42299e8794750cec66dfa7db0206.tar.xz
abrt-1202706839ec42299e8794750cec66dfa7db0206.zip
simplify logging a bit. warn_client() is gone, reuse error_msg() for it.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon')
-rw-r--r--src/Daemon/CommLayerServerSocket.cpp12
-rw-r--r--src/Daemon/CrashWatcher.cpp28
-rw-r--r--src/Daemon/Daemon.cpp2
-rw-r--r--src/Daemon/MiddleWare.cpp20
-rw-r--r--src/Daemon/PluginManager.cpp2
5 files changed, 30 insertions, 34 deletions
diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp
index 7afe4b6e..ee775c6d 100644
--- a/src/Daemon/CommLayerServerSocket.cpp
+++ b/src/Daemon/CommLayerServerSocket.cpp
@@ -26,7 +26,7 @@ void CCommLayerServerSocket::Send(const std::string& pData, GIOChannel *pDestina
ret = g_io_channel_write_chars(pDestination, message + offset, strlen(message + offset), &len, &err);
if (ret == G_IO_STATUS_ERROR)
{
- warn_client("Error during sending data.");
+ error_msg("Error during sending data");
}
}
@@ -72,7 +72,7 @@ gboolean CCommLayerServerSocket::client_socket_cb(GIOChannel *source, GIOConditi
ret = g_io_channel_read_chars(source, buff, 1, &len, &err);
if (ret == G_IO_STATUS_ERROR)
{
- warn_client(std::string("Error while reading data from client socket: ") + err->message);
+ error_msg("Error while reading data from client socket: %s", err->message);
return FALSE;
}
message += buff[0];
@@ -101,13 +101,13 @@ gboolean CCommLayerServerSocket::server_socket_cb(GIOChannel *source, GIOConditi
condition & G_IO_ERR ||
condition & G_IO_NVAL)
{
- warn_client("Server socket error.");
+ error_msg("Server socket error");
return FALSE;
}
if ((socket = accept(serverSocket->m_nSocket, (struct sockaddr *)&remote, &len)) == -1)
{
- warn_client("Server can not accept client.");
+ error_msg("Server can not accept client");
return TRUE;
}
log("New socket client connected");
@@ -117,7 +117,7 @@ gboolean CCommLayerServerSocket::server_socket_cb(GIOChannel *source, GIOConditi
static_cast<GIOFunc>(client_socket_cb),
data))
{
- warn_client("Can not init g_io_channel.");
+ error_msg("Can not init g_io_channel");
return TRUE;
}
serverSocket->m_mapClientChannels[socket] = gSocket;
@@ -157,7 +157,7 @@ void CCommLayerServerSocket::ProcessMessage(const std::string& pMessage, GIOChan
}
else
{
- warn_client("Received unknown message type.");
+ error_msg("Received unknown message type");
}
}
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index aa863505..e684277c 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -58,23 +58,23 @@ vector_crash_infos_t GetCrashInfos(const char *pUID)
{
mw_result_t res;
map_crash_info_t info;
+ const char *uuid = UUIDsUIDs[ii].first.c_str();
+ const char *uid = UUIDsUIDs[ii].second.c_str();
- res = GetCrashInfo(UUIDsUIDs[ii].first.c_str(), UUIDsUIDs[ii].second.c_str(), info);
+ res = GetCrashInfo(uuid, uid, info);
switch (res)
{
case MW_OK:
retval.push_back(info);
break;
case MW_ERROR:
- warn_client("Can not find debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting from database");
- update_client("Can not find debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting from database");
- DeleteCrashInfo(UUIDsUIDs[ii].first.c_str(), UUIDsUIDs[ii].second.c_str());
+ error_msg("Can't find dump directory for UUID %s, deleting from database", uuid);
+ DeleteCrashInfo(uuid, uid);
break;
case MW_FILE_ERROR:
+ error_msg("Can't open file in dump directory for UUID %s, deleting", uuid);
{
- warn_client("Can not open file in debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting");
- update_client("Can not open file in debug dump directory for UUID: " + UUIDsUIDs[ii].first + ", deleting");
- std::string debugDumpDir = DeleteCrashInfo(UUIDsUIDs[ii].first.c_str(), UUIDsUIDs[ii].second.c_str());
+ std::string debugDumpDir = DeleteCrashInfo(uuid, uid);
DeleteDebugDumpDir(debugDumpDir.c_str());
}
break;
@@ -89,8 +89,7 @@ vector_crash_infos_t GetCrashInfos(const char *pUID)
{
throw e;
}
- warn_client(e.what());
- update_client(e.what());
+ error_msg("%s", e.what());
}
//retval = GetCrashInfos(pUID);
@@ -123,15 +122,15 @@ map_crash_report_t GetJobResult(const char* pUUID, const char* pUID, int force)
case MW_OK:
break;
case MW_IN_DB_ERROR:
- warn_client(std::string("Did not find crash with UUID ") + pUUID + " in database");
+ error_msg("Can't find crash with UUID %s in database", pUUID);
break;
case MW_PLUGIN_ERROR:
- warn_client("Particular analyzer plugin isn't loaded or there is an error within plugin(s)");
+ error_msg("Particular analyzer plugin isn't loaded or there is an error within plugin(s)");
break;
case MW_CORRUPTED:
case MW_FILE_ERROR:
default:
- warn_client(std::string("Corrupted crash with UUID ") + pUUID + ", deleting");
+ error_msg("Corrupted crash with UUID %s, deleting", pUUID);
std::string debugDumpDir = DeleteCrashInfo(pUUID, pUID);
DeleteDebugDumpDir(debugDumpDir.c_str());
break;
@@ -162,7 +161,7 @@ static void* create_report(void* arg)
}
catch (CABRTException& e)
{
- warn_client(e.what());
+ error_msg("%s", e.what());
}
catch (...) {}
set_client_name(NULL);
@@ -220,8 +219,7 @@ bool DeleteDebugDump(const char *pUUID, const char *pUID)
{
throw e;
}
- warn_client(e.what());
- update_client(e.what());
+ error_msg("%s", e.what());
return false;
}
return true;
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index c6d0a029..67e72cca 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -572,7 +572,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin
}
catch (CABRTException& e)
{
- warn_client(e.what());
+ error_msg(e.what());
if (e.type() == EXCEP_FATAL)
{
free(buf);
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index 3f26ab09..6a635642 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -191,7 +191,7 @@ mw_result_t CreateCrashReport(const char *pUUID,
}
if (pUUID[0] == '\0' || row.m_sUUID != pUUID)
{
- warn_client(ssprintf("CreateCrashReport(): UUID '%s' is not in database", pUUID));
+ error_msg("UUID '%s' is not in database", pUUID);
return MW_IN_DB_ERROR;
}
@@ -236,7 +236,7 @@ mw_result_t CreateCrashReport(const char *pUUID,
}
catch (CABRTException& e)
{
- warn_client(e.what());
+ error_msg("%s", e.what());
if (e.type() == EXCEP_DD_OPEN)
{
return MW_ERROR;
@@ -266,8 +266,7 @@ void RunAction(const char *pActionDir,
}
catch (CABRTException& e)
{
- warn_client(ssprintf("RunAction(): %s", e.what()));
- update_client(ssprintf("Execution of '%s' was not successful: %s", pPluginName, e.what()));
+ error_msg("Execution of '%s' was not successful: %s", pPluginName, e.what());
}
}
@@ -295,8 +294,7 @@ void RunActionsAndReporters(const char *pDebugDumpDir)
}
catch (CABRTException& e)
{
- warn_client(e.what());
- update_client(ssprintf("Activation of plugin '%s' was not successful: %s", it_ar->first.c_str(), e.what()));
+ error_msg("Activation of plugin '%s' was not successful: %s", it_ar->first.c_str(), e.what());
}
}
}
@@ -435,7 +433,7 @@ report_status_t Report(const map_crash_report_t& pCrashReport,
{
ret[pluginName].push_back("0");
ret[pluginName].push_back(e.what());
- update_client(ssprintf("Reporting via %s' was not successful: %s", pluginName.c_str(), e.what()));
+ update_client("Reporting via %s' was not successful: %s", pluginName.c_str(), e.what());
}
}
}
@@ -564,7 +562,7 @@ static mw_result_t SavePackageDescriptionToDebugDump(const char *pExecutable,
}
catch (CABRTException& e)
{
- warn_client(e.what());
+ error_msg("%s", e.what());
if (e.type() == EXCEP_DD_SAVE)
{
return MW_FILE_ERROR;
@@ -600,7 +598,7 @@ static void RunAnalyzerActions(const char *pAnalyzer, const char *pDebugDumpDir)
}
catch (CABRTException& e)
{
- update_client(ssprintf("Action performed by '%s' was not successful: %s", pluginName.c_str(), e.what()));
+ update_client("Action performed by '%s' was not successful: %s", pluginName.c_str(), e.what());
}
}
}
@@ -682,7 +680,7 @@ mw_result_t SaveDebugDump(const char *pDebugDumpDir,
}
catch (CABRTException& e)
{
- warn_client(e.what());
+ error_msg("%s", e.what());
if (e.type() == EXCEP_DD_SAVE)
{
return MW_FILE_ERROR;
@@ -732,7 +730,7 @@ mw_result_t GetCrashInfo(const char *pUUID,
}
catch (CABRTException& e)
{
- warn_client(e.what());
+ error_msg("%s", e.what());
if (e.type() == EXCEP_DD_LOAD)
{
return MW_FILE_ERROR;
diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp
index aa0b5315..5b871515 100644
--- a/src/Daemon/PluginManager.cpp
+++ b/src/Daemon/PluginManager.cpp
@@ -179,7 +179,7 @@ void CPluginManager::LoadPlugin(const std::string& pName)
catch (CABRTException& e)
{
delete abrtPlugin;
- warn_client(ssprintf("Failed to load plugin %s: %s", pName.c_str(), e.what()));
+ error_msg("Failed to load plugin %s: %s", pName.c_str(), e.what());
}
}
}