From dc8ad3b59e41ffce53541411649b6838e905b8b5 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 25 Aug 2009 18:25:16 +0200 Subject: more sensible logging comm_layer_inner_debug was jumping through the hoops in order to simply send a message to stderr. this can be made much simpler. also, set logmode to LOGMODE_SYSLOG in abrt daemon, making its log visible if it is daemonized. Signed-off-by: Denys Vlasenko --- src/Daemon/CrashWatcher.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/Daemon/CrashWatcher.cpp') diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index f0593c1..ffc7133 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -24,7 +24,7 @@ void CCrashWatcher::Status(const std::string& pMessage, const std::string& pDest) { - std::cout << "Update: " + pMessage << std::endl; + log("Update: %s", pMessage.c_str()); //FIXME: send updates only to job owner if (g_pCommLayer != NULL) g_pCommLayer->Update(pDest, pMessage); @@ -32,15 +32,14 @@ void CCrashWatcher::Status(const std::string& pMessage, const std::string& pDest void CCrashWatcher::Warning(const std::string& pMessage) { - std::cerr << "Warning: " + pMessage << std::endl; + log("Warning: %s", pMessage.c_str()); if (g_pCommLayer != NULL) g_pCommLayer->Warning(pMessage); } void CCrashWatcher::Debug(const std::string& pMessage) { - //some logic to add logging levels? - std::cout << "Debug: " + pMessage << std::endl; + log("Debug: %s", pMessage.c_str()); } CCrashWatcher::CCrashWatcher() @@ -55,7 +54,7 @@ CCrashWatcher::~CCrashWatcher() vector_crash_infos_t CCrashWatcher::GetCrashInfos(const std::string &pUID) { vector_crash_infos_t retval; - Debug("Getting crash infos..."); + log("Getting crash infos..."); try { vector_pair_string_string_t UUIDsUIDs; @@ -117,7 +116,7 @@ static void *create_report(void *arg) { thread_data_t *thread_data = (thread_data_t *) arg; map_crash_info_t crashReport; - g_cw->Debug("Creating report..."); + log("Creating report..."); try { mw_result_t res; -- cgit