[geary/mcatanzaro/fatal-warnings] util-logging: fix fatal warnings logic




commit 2e99f0a66bed6d49b9db967f71f486327094b100
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Wed Aug 25 10:23:26 2021 -0500

    util-logging: fix fatal warnings logic
    
    If fatal criticals are enabled, we should not crash on a simple warning,
    because warnings are normal and less serious than criticals.
    
    If fatal warnings are enabled, we should definitely crash on criticals,
    because criticals indicate undefined behavior and are more serious than
    warnings.

 src/engine/util/util-logging.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/engine/util/util-logging.vala b/src/engine/util/util-logging.vala
index 97f9ab6a8..8f7895f92 100644
--- a/src/engine/util/util-logging.vala
+++ b/src/engine/util/util-logging.vala
@@ -78,9 +78,9 @@ namespace Geary.Logging {
                 var parts = debug_var.split(",");
                 if ("fatal-warnings" in parts) {
                     Logging.set_breakpoint_on |= GLib.LogLevelFlags.LEVEL_WARNING;
+                    Logging.set_breakpoint_on |= GLib.LogLevelFlags.LEVEL_CRITICAL;
                 }
                 if ("fatal-criticals" in parts) {
-                    Logging.set_breakpoint_on |= GLib.LogLevelFlags.LEVEL_WARNING;
                     Logging.set_breakpoint_on |= GLib.LogLevelFlags.LEVEL_CRITICAL;
                 }
             }


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