From 9753692a9af2bb0850e329f07677738bdbc34504 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Mon, 27 Oct 2025 11:17:08 +0700 Subject: [PATCH] fix(logs): respect NO_COLOR for partition names The partition name colors (e.g., Application:, NetworkOPs:) were ignoring the NO_COLOR environment variable and always applying color codes. Now both partition names and location suffixes properly respect should_log_use_colors() which honors NO_COLOR and terminal detection. --- src/ripple/basics/impl/Log.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ripple/basics/impl/Log.cpp b/src/ripple/basics/impl/Log.cpp index f4f52cdc5..ddde4584a 100644 --- a/src/ripple/basics/impl/Log.cpp +++ b/src/ripple/basics/impl/Log.cpp @@ -360,7 +360,8 @@ Logs::format( if (!partition.empty()) { #ifdef BEAST_ENHANCED_LOGGING - output += beast::detail::get_log_highlight_color(); + if (beast::detail::should_log_use_colors()) + output += beast::detail::get_log_highlight_color(); #endif output += partition + ":"; } @@ -392,7 +393,8 @@ Logs::format( } #ifdef BEAST_ENHANCED_LOGGING - output += "\033[0m"; + if (beast::detail::should_log_use_colors()) + output += "\033[0m"; #endif output += message;