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.
This commit is contained in:
Nicholas Dudfield
2025-10-27 11:17:08 +07:00
parent 70942e5882
commit 9753692a9a

View File

@@ -360,7 +360,8 @@ Logs::format(
if (!partition.empty()) if (!partition.empty())
{ {
#ifdef BEAST_ENHANCED_LOGGING #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 #endif
output += partition + ":"; output += partition + ":";
} }
@@ -392,7 +393,8 @@ Logs::format(
} }
#ifdef BEAST_ENHANCED_LOGGING #ifdef BEAST_ENHANCED_LOGGING
output += "\033[0m"; if (beast::detail::should_log_use_colors())
output += "\033[0m";
#endif #endif
output += message; output += message;