perf(protocol): skip string debug escaping when proto debug is off
output_escape() was called on every send_str/receive_str even when LOG_DEBUG_PROTO logging was disabled, allocating and scanning the whole payload for a line that log_debug_message() then discarded. Add a log_debug_enabled(flag) gate mirroring log_debug_message()'s own filter and check it before escaping. Redacted (secret) strings still log the same <redacted> marker; no observable log output changes.
This commit is contained in:
@@ -27,6 +27,10 @@ uint32_t get_log_debug_flags(void) {
|
||||
return current_debug_flags;
|
||||
}
|
||||
|
||||
bool log_debug_enabled(LogDebugFlag flag) {
|
||||
return current_log_level <= LOG_LEVEL_DEBUG && (current_debug_flags & flag) != 0;
|
||||
}
|
||||
|
||||
void set_log_info_flags(uint32_t flags) {
|
||||
info_flags = flags;
|
||||
info_flags_explicit = true;
|
||||
|
||||
Reference in New Issue
Block a user