[tracker/sam/tracker-2.3-developer-experience: 30/45] cli: Initialize logging so that TRACKER_VERBOSITY works as expected



commit 3027907b70ca9edc24cf642fad35b9614a530d78
Author: Sam Thursfield <sam afuera me uk>
Date:   Sun Sep 15 23:38:05 2019 +0200

    cli: Initialize logging so that TRACKER_VERBOSITY works as expected
    
    I sometimes want to see the log output from the 'direct' backend and
    expect `TRACKER_VERBOSITY=3 tracker sparql -q ...` give me verbose
    log output. Now it does!

 src/tracker/tracker-main.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/tracker/tracker-main.c b/src/tracker/tracker-main.c
index 09dc12fa4..50dc4bed5 100644
--- a/src/tracker/tracker-main.c
+++ b/src/tracker/tracker-main.c
@@ -131,6 +131,7 @@ run_builtin (struct cmd_struct *p, int argc, const char **argv)
 static void
 handle_command (int argc, const char **argv)
 {
+       gchar *log_filename = NULL;
        const char *cmd = argv[0];
        int i;
 
@@ -140,6 +141,12 @@ handle_command (int argc, const char **argv)
                argv[0] = cmd = "help";
        }
 
+       tracker_log_init (0, &log_filename);
+       if (log_filename != NULL) {
+               g_message ("Using log file:'%s'", log_filename);
+               g_free (log_filename);
+       }
+
        for (i = 0; i < G_N_ELEMENTS (commands); i++) {
                struct cmd_struct *p = commands + i;
 


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