[geary/mjog/logging-improvements: 13/23] Application.Client: Add command line flag for logging SQL results



commit b2e99dcef2f320bcf3a7e0e9c51bb56bd5a92f42
Author: Michael Gratton <mike vee net>
Date:   Thu Apr 16 11:44:26 2020 +1000

    Application.Client: Add command line flag for logging SQL results

 src/client/application/application-client.vala | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/client/application/application-client.vala b/src/client/application/application-client.vala
index 1f8dfb03..e2c87b24 100644
--- a/src/client/application/application-client.vala
+++ b/src/client/application/application-client.vala
@@ -69,6 +69,7 @@ public class Application.Client : Gtk.Application {
     private const string OPTION_LOG_REPLAY_QUEUE = "log-replay-queue";
     private const string OPTION_LOG_SMTP = "log-smtp";
     private const string OPTION_LOG_SQL = "log-sql";
+    private const string OPTION_LOG_SQL_RESULTS = "log-sql-results";
     private const string OPTION_HIDDEN = "hidden";
     private const string OPTION_NEW_WINDOW = "new-window";
     private const string OPTION_QUIT = "quit";
@@ -123,7 +124,10 @@ public class Application.Client : Gtk.Application {
           N_("Log SMTP messages"), null },
         { OPTION_LOG_SQL, 0, 0, GLib.OptionArg.NONE, null,
           /// Command line option
-          N_("Log database queries (generates lots of messages)"), null },
+          N_("Log database queries"), null },
+        { OPTION_LOG_SQL_RESULTS, 0, 0, GLib.OptionArg.NONE, null,
+          /// Command line option
+          N_("Log database query results (generates lots of messages)"), null },
         { OPTION_QUIT, 'q', 0, GLib.OptionArg.NONE, null,
           /// Command line option
           N_("Perform a graceful quit"), null },
@@ -942,9 +946,13 @@ public class Application.Client : Gtk.Application {
                 Geary.Smtp.ClientService.PROTOCOL_LOGGING_DOMAIN
             );
         }
-        if (!options.contains(OPTION_LOG_SQL)) {
+        if (!options.contains(OPTION_LOG_SQL) &&
+            !options.contains(OPTION_LOG_SQL_RESULTS)) {
             Geary.Logging.suppress_domain(Geary.Db.Context.LOGGING_DOMAIN);
         }
+        if (options.contains(OPTION_LOG_SQL_RESULTS)) {
+            Geary.Db.Result.log_results = true;
+        }
 
         if (options.contains(OPTION_HIDDEN)) {
             warning(


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