]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hlua: Fix log level to the right value when set via TXN:set_loglevel
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Feb 2024 14:37:43 +0000 (15:37 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 1 Mar 2024 14:01:18 +0000 (15:01 +0100)
When the log level is changed in lua, by calling TXN:set_loglevel function,
it must be incremented by one because it is decremented in strm_log()
function.

This patch must be backport to all stable versions.

src/hlua.c

index dffccd4f37246a84b91c23c33d81e1885f28345e..fdbd2cbc2f9e4b4f18e0267c31c0a79d16f429db 100644 (file)
@@ -8246,7 +8246,7 @@ __LJMP static int hlua_txn_set_loglevel(lua_State *L)
        if (ll < 0 || ll > 7)
                WILL_LJMP(luaL_argerror(L, 2, "Bad log level. It must be between 0 and 7"));
 
-       htxn->s->logs.level = ll;
+       htxn->s->logs.level = ll + 1;
        return 0;
 }