]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEBUG: make the "debug dev {debug|warn|check}" command print a message
authorWilly Tarreau <w@1wt.eu>
Mon, 5 Feb 2024 15:23:32 +0000 (16:23 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 5 Feb 2024 16:09:00 +0000 (17:09 +0100)
In order to test the new message output capability, these commands will
now explicitly mention that the bug was triggered from the CLI.

src/debug.c

index 040c23a5517ab236c754afe1f5157af0d196fb46..e69a8274367f37616d6407e6ef967ee035ef6076 100644 (file)
@@ -658,7 +658,7 @@ int debug_parse_cli_bug(char **args, char *payload, struct appctx *appctx, void
                return 1;
 
        _HA_ATOMIC_INC(&debug_commands_issued);
-       BUG_ON(one > zero);
+       BUG_ON(one > zero, "This was triggered on purpose from the CLI 'debug dev bug' command.");
        return 1;
 }
 
@@ -671,7 +671,7 @@ int debug_parse_cli_warn(char **args, char *payload, struct appctx *appctx, void
                return 1;
 
        _HA_ATOMIC_INC(&debug_commands_issued);
-       WARN_ON(one > zero);
+       WARN_ON(one > zero, "This was triggered on purpose from the CLI 'debug dev warn' command.");
        return 1;
 }
 
@@ -684,7 +684,7 @@ int debug_parse_cli_check(char **args, char *payload, struct appctx *appctx, voi
                return 1;
 
        _HA_ATOMIC_INC(&debug_commands_issued);
-       CHECK_IF(one > zero);
+       CHECK_IF(one > zero, "This was triggered on purpose from the CLI 'debug dev check' command.");
        return 1;
 }