summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-26 17:19:31 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-26 17:19:31 +0200
commit508a713fd489749c8ee56d47f47a984b09aaf318 (patch)
tree5c510d2a0cd05b3f905a36626130627022486684
parent1c278e761795d1f669bebfc2fd3d2ac8c5e08392 (diff)
downloadabrt-508a713fd489749c8ee56d47f47a984b09aaf318.tar.gz
abrt-508a713fd489749c8ee56d47f47a984b09aaf318.tar.xz
abrt-508a713fd489749c8ee56d47f47a984b09aaf318.zip
abrt-cli: suppress misleading "crash 'XXXXXXXX' is not in database" messages
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--src/CLI/CLI.cpp4
-rw-r--r--src/CLI/dbus.cpp2
-rw-r--r--src/CLI/report.cpp10
-rw-r--r--src/CLI/report.h6
4 files changed, 15 insertions, 7 deletions
diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp
index c417619c..3f3164d3 100644
--- a/src/CLI/CLI.cpp
+++ b/src/CLI/CLI.cpp
@@ -238,11 +238,11 @@ int main(int argc, char** argv)
}
case OPT_REPORT:
case OPT_REPORT_ALWAYS:
- exitcode = report(crash_id, op == OPT_REPORT_ALWAYS);
+ exitcode = report(crash_id, (op == OPT_REPORT_ALWAYS)*CLI_REPORT_BATCH + CLI_REPORT_SILENT_IF_NOT_FOUND);
if (exitcode == -1) /* no such crash_id */
{
crash_id = guess_crash_id(crash_id);
- exitcode = report(crash_id, op == OPT_REPORT_ALWAYS);
+ exitcode = report(crash_id, (op == OPT_REPORT_ALWAYS) * CLI_REPORT_BATCH);
if (exitcode == -1)
error_msg_and_die("Crash '%s' not found", crash_id);
}
diff --git a/src/CLI/dbus.cpp b/src/CLI/dbus.cpp
index 9dd5bff7..2eddb5d9 100644
--- a/src/CLI/dbus.cpp
+++ b/src/CLI/dbus.cpp
@@ -102,7 +102,7 @@ static DBusMessage* send_get_reply_and_unref(DBusMessage* msg)
{
error_msg_and_die("dbus Update message: arguments mismatch");
}
- printf(">! %s\n", warning_msg);
+ log(">! %s\n", warning_msg);
}
else
if (tp == DBUS_MESSAGE_TYPE_METHOD_RETURN
diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp
index cb88c3ca..e3ecb0e3 100644
--- a/src/CLI/report.cpp
+++ b/src/CLI/report.cpp
@@ -647,17 +647,21 @@ static void get_reporter_plugin_settings(const vector_string_t& reporters,
}
/* Reports the crash with corresponding crash_id over DBus. */
-int report(const char *crash_id, bool always)
+int report(const char *crash_id, int flags)
{
+ int old_logmode = logmode;
+ if (flags & CLI_REPORT_SILENT_IF_NOT_FOUND)
+ logmode = 0;
// Ask for an initial report.
map_crash_data_t cr = call_CreateReport(crash_id);
+ logmode = old_logmode;
if (cr.size() == 0)
{
return -1;
}
/* Open text editor and give a chance to review the backtrace etc. */
- if (!always)
+ if (!(flags & CLI_REPORT_BATCH))
{
int result = run_report_editor(cr);
if (result != 0)
@@ -669,7 +673,7 @@ int report(const char *crash_id, bool always)
int errors = 0;
int plugins = 0;
- if (always)
+ if (flags & CLI_REPORT_BATCH)
{
map_map_string_t reporters_settings; /* to be filled on the next line */
get_reporter_plugin_settings(reporters, reporters_settings, false);
diff --git a/src/CLI/report.h b/src/CLI/report.h
index 2969b650..8a851b8e 100644
--- a/src/CLI/report.h
+++ b/src/CLI/report.h
@@ -19,6 +19,10 @@
#define ABRT_CLI_REPORT_H
/* Reports the crash with corresponding uuid over DBus. */
-int report(const char *uuid, bool always);
+enum {
+ CLI_REPORT_BATCH = 1 << 0,
+ CLI_REPORT_SILENT_IF_NOT_FOUND = 1 << 1,
+};
+int report(const char *uuid, int flags);
#endif