Blob Blame Raw
From 03c64e1439baf60426b002ecb1b7052a426d348e Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Wed, 27 Aug 2014 09:30:54 +0200
Subject: [PATCH] logging: less log messages for duplicates

Related to rhbz#1133674

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/daemon/abrt-handle-event.c | 4 ++--
 src/daemon/abrt-server.c       | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/daemon/abrt-handle-event.c b/src/daemon/abrt-handle-event.c
index a65f86e..2ed88db 100644
--- a/src/daemon/abrt-handle-event.c
+++ b/src/daemon/abrt-handle-event.c
@@ -142,7 +142,7 @@ static int dup_uuid_compare(const struct dump_dir *dd)
     free(dd_uuid);
 
     if (!different)
-        log("Duplicate: UUID");
+        log_notice("Duplicate: UUID");
 
     return !different;
 }
@@ -197,7 +197,7 @@ static int dup_corebt_compare(const struct dump_dir *dd)
     free(dd_corebt);
 
     if (isdup)
-        log("Duplicate: core backtrace");
+        log_notice("Duplicate: core backtrace");
 
     return isdup;
 }
diff --git a/src/daemon/abrt-server.c b/src/daemon/abrt-server.c
index 307b41b..9951468 100644
--- a/src/daemon/abrt-server.c
+++ b/src/daemon/abrt-server.c
@@ -194,15 +194,14 @@ static int run_post_create(const char *dirname)
             strbuf_append_str(cmd_output, raw);
             char *msg = cmd_output->buf;
 
-            /* Hmm, DUP_OF_DIR: ends up in syslog. move log() into 'else'? */
-            log("%s", msg);
-
             if (child_is_post_create
              && prefixcmp(msg, "DUP_OF_DIR: ") == 0
             ) {
                 free(dup_of_dir);
                 dup_of_dir = xstrdup(msg + strlen("DUP_OF_DIR: "));
             }
+            else
+                log("%s", msg);
 
             strbuf_clear(cmd_output);
             /* jump to next line */
-- 
1.9.3