mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-31 02:50:10 +00:00
refactor: rename LOG_HIGHLIGHT_ESCAPE to LOG_HIGHLIGHT_COLOR
- More intuitive naming for users - Changed get_log_highlight_escape() to get_log_highlight_color() - Updated all references and comments - Functionality remains the same, just clearer naming
This commit is contained in:
@@ -354,7 +354,7 @@ Logs::format(
|
||||
if (!partition.empty())
|
||||
{
|
||||
#ifdef BEAST_ENHANCED_LOGGING
|
||||
output += beast::detail::get_log_highlight_escape();
|
||||
output += beast::detail::get_log_highlight_color();
|
||||
#endif
|
||||
output += partition + ":";
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace detail {
|
||||
bool
|
||||
should_log_use_colors();
|
||||
|
||||
// Get the log location escape sequence - can be overridden via
|
||||
// LOG_LOCATION_ESCAPE
|
||||
// Get the log highlight color - can be overridden via
|
||||
// LOG_HIGHLIGHT_COLOR
|
||||
const char*
|
||||
get_log_highlight_escape();
|
||||
get_log_highlight_color();
|
||||
|
||||
// Strip source root path from __FILE__ at compile time
|
||||
// IMPORTANT: This MUST stay in the header as constexpr for compile-time
|
||||
|
||||
@@ -45,13 +45,13 @@ should_log_use_colors()
|
||||
return use_colors;
|
||||
}
|
||||
|
||||
// Get the log location escape sequence - can be overridden via
|
||||
// LOG_LOCATION_ESCAPE
|
||||
// Get the log highlight color - can be overridden via
|
||||
// LOG_HIGHLIGHT_COLOR
|
||||
const char*
|
||||
get_log_highlight_escape()
|
||||
get_log_highlight_color()
|
||||
{
|
||||
static const char* escape = []() {
|
||||
const char* env = std::getenv("LOG_HIGHLIGHT_ESCAPE");
|
||||
const char* env = std::getenv("LOG_HIGHLIGHT_COLOR");
|
||||
if (!env)
|
||||
return "\033[36m"; // Default: cyan
|
||||
|
||||
@@ -111,7 +111,7 @@ log_write_location_string(std::ostream& os, const char* file, int line)
|
||||
{
|
||||
if (detail::should_log_use_colors())
|
||||
{
|
||||
os << detail::get_log_highlight_escape() << "["
|
||||
os << detail::get_log_highlight_color() << "["
|
||||
<< detail::strip_source_root(file) << ":" << line << "]\033[0m";
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user