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