[tracker/sam/functional-tests-shared: 5/7] Use g_message() instead of g_print() in daemons



commit 2937c948372293b9fcce53e8102f65f8993eb6cc
Author: Sam Thursfield <sam afuera me uk>
Date:   Wed Aug 7 17:10:24 2019 +0200

    Use g_message() instead of g_print() in daemons
    
    Daemons shouldn't be noisy by default. You can still set
    G_MESSAGES_DEBUG=Tracker and/or TRACKER_VERBOSITY=1
    to see these messages.
    
    This reduces the noise in the logs generated by the functional-tests.

 src/tracker-store/tracker-main.vala | 6 ++----
 src/tracker/tracker-daemon.c        | 7 +++----
 2 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/src/tracker-store/tracker-main.vala b/src/tracker-store/tracker-main.vala
index 1e8d1ddd2..a60bb649d 100644
--- a/src/tracker-store/tracker-main.vala
+++ b/src/tracker-store/tracker-main.vala
@@ -118,14 +118,12 @@ License which can be viewed at:
                        do_shutdown ();
 
                        if (strsignal (signo) != null) {
-                               print ("\n");
-                               print ("Received signal:%d->'%s'", signo, strsignal (signo));
+                               message ("Received signal:%d->'%s'", signo, strsignal (signo));
                        }
                        break;
                default:
                        if (strsignal (signo) != null) {
-                               print ("\n");
-                               print ("Received signal:%d->'%s'", signo, strsignal (signo));
+                               message ("Received signal:%d->'%s'", signo, strsignal (signo));
                        }
                        break;
                }
diff --git a/src/tracker/tracker-daemon.c b/src/tracker/tracker-daemon.c
index 2c25b2c07..c73658477 100644
--- a/src/tracker/tracker-daemon.c
+++ b/src/tracker/tracker-daemon.c
@@ -228,10 +228,9 @@ signal_handler (gpointer user_data)
                /* Fall through */
        default:
                if (g_strsignal (signo)) {
-                       g_print ("\n");
-                       g_print ("Received signal:%d->'%s'\n",
-                                signo,
-                                g_strsignal (signo));
+                       g_message ("Received signal:%d->'%s'",
+                                  signo,
+                                  g_strsignal (signo));
                }
                break;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]