From: Arran Cudbard-Bell Date: Sat, 23 Feb 2019 14:30:10 +0000 (+0800) Subject: Print the result of policy evaluations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=928715c569db65fac2ef71a1f535941f6a7565cc;p=thirdparty%2Ffreeradius-server.git Print the result of policy evaluations --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 0612018a724..38717a1386c 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -471,8 +471,18 @@ static inline unlang_frame_action_t unlang_frame_eval(REQUEST *request, unlang_s if (unlang_ops[instruction->type].debug_braces) { REXDENT(); - RDEBUG2("} # %s (%s)", instruction->debug_name, - fr_int2str(mod_rcode_table, *result, "")); + + /* + * If we're at debug level 1, don't emit the closing + * brace as the opening brace wasn't emitted. + */ + if (RDEBUG_ENABLED && !RDEBUG_ENABLED2) { + RDEBUG("# %s (%s)", instruction->debug_name, + fr_int2str(mod_rcode_table, *result, "")); + } else { + RDEBUG2("} # %s (%s)", instruction->debug_name, + fr_int2str(mod_rcode_table, *result, "")); + } } if (unlang_calculate_result(request, frame, result, priority) == UNLANG_FRAME_ACTION_POP) { @@ -582,8 +592,18 @@ rlm_rcode_t unlang_run(REQUEST *request) */ if (unlang_ops[frame->instruction->type].debug_braces) { REXDENT(); - RDEBUG2("} # %s (%s)", frame->instruction->debug_name, - fr_int2str(mod_rcode_table, stack->result, "")); + + /* + * If we're at debug level 1, don't emit the closing + * brace as the opening brace wasn't emitted. + */ + if (RDEBUG_ENABLED && !RDEBUG_ENABLED2) { + RDEBUG("# %s (%s)", frame->instruction->debug_name, + fr_int2str(mod_rcode_table, stack->result, "")); + } else { + RDEBUG2("} # %s (%s)", frame->instruction->debug_name, + fr_int2str(mod_rcode_table, stack->result, "")); + } } fa = unlang_calculate_result(request, frame, &stack->result, &priority);