diff options
| author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-28 17:08:09 +0200 |
|---|---|---|
| committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-28 17:08:09 +0200 |
| commit | 2e6a6e8aed825e456600d01c8a805b6f6fd24c3a (patch) | |
| tree | c58cba2913350fed9674813b3fe0a27e6639fbd2 /lib/Plugins | |
| parent | b08d5c2cf630ecb89d2f22b985dcdfcf25494258 (diff) | |
new commlayerinner interface
Diffstat (limited to 'lib/Plugins')
| -rw-r--r-- | lib/Plugins/Bugzilla.cpp | 9 | ||||
| -rw-r--r-- | lib/Plugins/CCpp.cpp | 12 | ||||
| -rw-r--r-- | lib/Plugins/Kerneloops.cpp | 9 | ||||
| -rw-r--r-- | lib/Plugins/KerneloopsReporter.cpp | 4 | ||||
| -rw-r--r-- | lib/Plugins/Logger.cpp | 3 | ||||
| -rw-r--r-- | lib/Plugins/Mailx.cpp | 5 | ||||
| -rw-r--r-- | lib/Plugins/Makefile.am | 14 | ||||
| -rw-r--r-- | lib/Plugins/RunApp.cpp | 3 |
8 files changed, 43 insertions, 16 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index ed9e02c..7a56966 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -4,6 +4,7 @@ #include "PluginSettings.h" #include "DebugDump.h" #include "ABRTException.h" +#include "ABRTCommLayer.h" #include <iostream> CReporterBugzilla::CReporterBugzilla() : @@ -34,7 +35,7 @@ void CReporterBugzilla::Login() { rpc->call(m_pXmlrpcClient, m_pCarriageParm); ret = xmlrpc_c::value_struct(rpc->getResult()); - std::cerr << "Login id: " << xmlrpc_c::value_int(ret["id"]) << std::endl; + ABRTCommLayer::debug("Login id: " + xmlrpc_c::value_int(ret["id"])); } catch (std::exception& e) { @@ -155,7 +156,7 @@ void CReporterBugzilla::NewBug(const map_crash_report_t& pCrashReport) { rpc->call(m_pXmlrpcClient, m_pCarriageParm); ret = xmlrpc_c::value_struct(rpc->getResult()); - std::cerr << "New bug id: " << xmlrpc_c::value_int(ret["id"]) << std::endl; + ABRTCommLayer::debug("New bug id: " + xmlrpc_c::value_int(ret["id"])); } catch (std::exception& e) { @@ -169,11 +170,15 @@ void CReporterBugzilla::Report(const map_crash_report_t& pCrashReport, const std std::string package = pCrashReport.find(FILENAME_PACKAGE)->second[CD_CONTENT]; std::string component = package.substr(0, package.rfind("-", package.rfind("-")-1)); std::string uuid = pCrashReport.find(CD_UUID)->second[CD_CONTENT]; + ABRTCommLayer::status("Logging into bugzilla..."); Login(); + ABRTCommLayer::status("Checking for duplicates..."); if (!CheckUUIDInBugzilla(component, uuid)) { + ABRTCommLayer::status("Creating new bug..."); NewBug(pCrashReport); } + ABRTCommLayer::status("Logging out..."); Logout(); } diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 7aacc2f..da52d0b 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -23,7 +23,7 @@ #include "ABRTException.h" #include "DebugDump.h" #include "PluginSettings.h" -#include "CommLayer.h" +#include "ABRTCommLayer.h" #include <fstream> #include <sstream> #include <iostream> @@ -89,7 +89,7 @@ std::string CAnalyzerCCpp::CreateHash(const std::string& pInput) void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) { - CommLayerInner::status("Installing debug infos..."); + ABRTCommLayer::status("Installing debug infos..."); std::string packageName = pPackage.substr(0, pPackage.rfind("-", pPackage.rfind("-")-1)); char buff[1024]; @@ -195,7 +195,7 @@ void CAnalyzerCCpp::InstallDebugInfos(const std::string& pPackage) void CAnalyzerCCpp::GetBacktrace(const std::string& pDebugDumpDir, std::string& pBacktrace) { - CommLayerInner::status("Getting backtrace..."); + ABRTCommLayer::status("Getting backtrace..."); std::string tmpFile = "/tmp/" + pDebugDumpDir.substr(pDebugDumpDir.rfind("/")); std::ofstream fTmp; @@ -422,7 +422,7 @@ void CAnalyzerCCpp::ExecVP(const char* pCommand, char* const pArgs[], const std: std::string CAnalyzerCCpp::GetLocalUUID(const std::string& pDebugDumpDir) { - CommLayerInner::status("Getting global universal unique identification..."); + ABRTCommLayer::status("Getting local universal unique identification..."); CDebugDump dd; std::string UID; @@ -446,7 +446,7 @@ std::string CAnalyzerCCpp::GetLocalUUID(const std::string& pDebugDumpDir) } std::string CAnalyzerCCpp::GetGlobalUUID(const std::string& pDebugDumpDir) { - CommLayerInner::status("Getting local universal unique identification..."); + ABRTCommLayer::status("Getting global universal unique identification..."); std::string backtrace; std::string executable; @@ -464,7 +464,7 @@ std::string CAnalyzerCCpp::GetGlobalUUID(const std::string& pDebugDumpDir) void CAnalyzerCCpp::CreateReport(const std::string& pDebugDumpDir) { - CommLayerInner::status("Starting report creation..."); + ABRTCommLayer::status("Starting report creation..."); std::string package; std::string backtrace; diff --git a/lib/Plugins/Kerneloops.cpp b/lib/Plugins/Kerneloops.cpp index 179ba41..3b8fce6 100644 --- a/lib/Plugins/Kerneloops.cpp +++ b/lib/Plugins/Kerneloops.cpp @@ -29,6 +29,7 @@ #include "DebugDump.h" #include "PluginSettings.h" #include "ABRTException.h" +#include "ABRTCommLayer.h" #include <sstream> #include <assert.h> @@ -58,6 +59,8 @@ void CAnalyzerKerneloops::WriteSysLog(int m_nCount) std::string CAnalyzerKerneloops::GetLocalUUID(const std::string& pDebugDumpDir) { + ABRTCommLayer::status("Getting local/global universal unique identification..."); + std::string m_sOops; std::stringstream m_sHash; CDebugDump m_pDebugDump; @@ -85,6 +88,8 @@ std::string CAnalyzerKerneloops::GetGlobalUUID(const std::string& pDebugDumpDir) void CAnalyzerKerneloops::Report() { + ABRTCommLayer::status("Creating crash reports..."); + CDebugDump m_pDebugDump; char m_sPath[PATH_MAX]; std::list<COops> m_pOopsList; @@ -157,6 +162,8 @@ void CAnalyzerKerneloops::Init() void CAnalyzerKerneloops::ScanDmesg() { + ABRTCommLayer::debug("Scanning dmesg..."); + int m_nFoundOopses; char *buffer; @@ -172,6 +179,8 @@ void CAnalyzerKerneloops::ScanDmesg() void CAnalyzerKerneloops::ScanSysLogFile(const char *filename, int issyslog) { + ABRTCommLayer::debug("Scanning syslog..."); + char *buffer; struct stat statb; FILE *file; diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp index 15af3ac..cbefe0e 100644 --- a/lib/Plugins/KerneloopsReporter.cpp +++ b/lib/Plugins/KerneloopsReporter.cpp @@ -25,8 +25,8 @@ */ #include "KerneloopsReporter.h" -#include "DebugDump.h" #include "PluginSettings.h" +#include "ABRTCommLayer.h" #include <stdlib.h> #include <string.h> @@ -59,6 +59,8 @@ size_t writefunction(void *ptr, size_t size, size_t nmemb, void __attribute((unu void CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport, const std::string& pArgs) { + ABRTCommLayer::status("Creating and submitting a report..."); + CURL *handle; struct curl_httppost *post = NULL; struct curl_httppost *last = NULL; diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp index 43c219f..9d972e3 100644 --- a/lib/Plugins/Logger.cpp +++ b/lib/Plugins/Logger.cpp @@ -24,6 +24,7 @@ #include "PluginSettings.h" #include <sstream> #include "DebugDump.h" +#include "ABRTCommLayer.h" CLogger::CLogger() : m_sLogPath("/var/log/abrt-logger"), @@ -47,6 +48,8 @@ void CLogger::LoadSettings(const std::string& pPath) void CLogger::Report(const map_crash_report_t& pCrashReport, const std::string& pArgs) { + ABRTCommLayer::status("Creating a report..."); + std::stringstream binaryFiles, commonFiles, bigTextFiles, additionalFiles, UUIDFile; std::ofstream fOut; diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index 6a5cb59..069e013 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -25,6 +25,7 @@ #include "DebugDump.h" #include "ABRTException.h" #include "PluginSettings.h" +#include "ABRTCommLayer.h" #define MAILX_COMMAND "/bin/mailx" @@ -40,6 +41,8 @@ CMailx::CMailx() : void CMailx::SendEmail(const std::string& pSubject, const std::string& pText) { + ABRTCommLayer::status("Sending an email..."); + FILE* command; std::string mailx_command = MAILX_COMMAND + m_sAttachments + " " + m_sParameters + @@ -61,6 +64,8 @@ void CMailx::SendEmail(const std::string& pSubject, const std::string& pText) void CMailx::Report(const map_crash_report_t& pCrashReport, const std::string& pArgs) { + ABRTCommLayer::status("Creating a report..."); + std::stringstream emailBody; std::stringstream binaryFiles, commonFiles, bigTextFiles, additionalFiles, UUIDFile; diff --git a/lib/Plugins/Makefile.am b/lib/Plugins/Makefile.am index 3b91de2..3e4aec6 100644 --- a/lib/Plugins/Makefile.am +++ b/lib/Plugins/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils +AM_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils pluginslibdir=$(PLUGINS_LIB_DIR) pluginslib_LTLIBRARIES = libCCpp.la \ libMailx.la \ @@ -17,18 +17,18 @@ dist_pluginsconf_DATA = CCpp.conf Mailx.conf SQLite3.conf Logger.conf Kerneloops libCCpp_la_SOURCES = CCpp.cpp CCpp.h PluginSettings.h libCCpp_la_LDFLAGS = -avoid-version libCCpp_la_LIBADD = $(NSS_LIBS) -libCCpp_la_CPPFLAGS = -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils -I$(srcdir)/../CommLayer -DCCPP_HOOK_PATH=\"${libexecdir}/hookCCpp\" -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(NSS_CFLAGS) +libCCpp_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils -DCCPP_HOOK_PATH=\"${libexecdir}/hookCCpp\" -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(NSS_CFLAGS) # Kerneloops libKerneloops_la_SOURCES = Kerneloops.cpp Kerneloops.h KerneloopsSysLog.cpp KerneloopsSysLog.h PluginSettings.h libKerneloops_la_LDFLAGS = -avoid-version -libKerneloops_la_CPPFLAGS = -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" -DCCPP_HOOK_PATH=\"${libexecdir}/hookKerneloopsoops\" +libKerneloops_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" -DCCPP_HOOK_PATH=\"${libexecdir}/hookKerneloopsoops\" # KerneloopsReporter libKerneloopsReporter_la_SOURCES = KerneloopsReporter.cpp KerneloopsReporter.h PluginSettings.h libKerneloopsReporter_la_LDFLAGS = -avoid-version libKerneloopsReporter_la_LIBADD = $(CURL_LIBS) -libKerneloopsReporter_la_CPPFLAGS = -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils $(CURL_CFLAGS) +libKerneloopsReporter_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../MiddleWare $(CURL_CFLAGS) # Mailx libMailx_la_SOURCES = Mailx.cpp Mailx.h PluginSettings.h @@ -38,7 +38,7 @@ libMailx_la_LDFLAGS = -avoid-version libSQLite3_la_SOURCES = SQLite3.cpp SQLite3.h PluginSettings.h libSQLite3_la_LDFLAGS = -avoid-version libSQLite3_la_LIBADD = $(SQLITE3_LIBS) -libSQLite3_la_CPPFLAGS = -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils $(SQLITE3_CFLAGS) +libSQLite3_la_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils $(SQLITE3_CFLAGS) # Logger libLogger_la_SOURCES = Logger.cpp Logger.h PluginSettings.h @@ -52,11 +52,11 @@ libRunApp_la_LDFLAGS = -avoid-version libBugzilla_la_SOURCES = Bugzilla.h Bugzilla.cpp libBugzilla_la_LIBADD = $(XMLRPC_CPP_LIBS) $(XMLRPC_CLIENT_CPP_LIBS) libBugzilla_la_LDFLAGS = -avoid-version -libBugzilla_la_CPPFLAGS = $(XMLRPC_CPP_CFLAGS) $(XMLRPC_CLIENT_CPP_CFLAGS) -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils +libBugzilla_la_CPPFLAGS = $(XMLRPC_CPP_CFLAGS) $(XMLRPC_CLIENT_CPP_CFLAGS) -I$(srcdir)/../../inc -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils # Python libPython_la_SOURCES = Python.h Python.cpp #libPython_la_LIBADD = $(NSS_LIBS) libPython_la_LDFLAGS = -avoid-version -libPython_la_CPPFLAGS = $(NSS_CFLAGS) -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils +libPython_la_CPPFLAGS = $(NSS_CFLAGS) -I$(srcdir)/../../inc -I$(srcdir)/../MiddleWare -I$(srcdir)/../Utils diff --git a/lib/Plugins/RunApp.cpp b/lib/Plugins/RunApp.cpp index 8a8db08..5a20283 100644 --- a/lib/Plugins/RunApp.cpp +++ b/lib/Plugins/RunApp.cpp @@ -24,6 +24,7 @@ #include <stdio.h> #include "DebugDump.h" #include "ABRTException.h" +#include "ABRTCommLayer.h" #define COMMAND 0 #define FILENAME 1 @@ -58,6 +59,8 @@ void CActionRunApp::ParseArgs(const std::string& psArgs, vector_args_t& pArgs) void CActionRunApp::Run(const std::string& pDebugDumpDir, const std::string& pArgs) { + ABRTCommLayer::status("Executing RunApp plugin..."); + char line[1024]; std::string output = ""; |
