From 9a12eba62f79d8636deb94e1facac8b86f5fb2b5 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 18 Sep 2023 12:51:36 -0400 Subject: [PATCH] indentlog: refactor: log_config.nesting_level_color color_spec --- include/indentlog/log_config.hpp | 6 +++--- include/indentlog/log_state.hpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/indentlog/log_config.hpp b/include/indentlog/log_config.hpp index 4f48b0f6..d3e8c91d 100644 --- a/include/indentlog/log_config.hpp +++ b/include/indentlog/log_config.hpp @@ -26,7 +26,7 @@ namespace xo { /* if true enable explicit nesting level display [nnn] */ static bool nesting_level_enabled; /* color to use for explicit nesting level */ - static std::uint32_t nesting_level_color; + static color_spec nesting_level_color; /* display style for function names. FS_Simple|FS_Pretty|FS_Streamlined */ static function_style style; /* color encoding */ @@ -73,8 +73,8 @@ namespace xo { log_config_impl::nesting_level_enabled = true; template - std::uint32_t - log_config_impl::nesting_level_color = 195; + color_spec + log_config_impl::nesting_level_color = color_spec::xterm(195); template function_style diff --git a/include/indentlog/log_state.hpp b/include/indentlog/log_state.hpp index 834aa119..6895fb25 100644 --- a/include/indentlog/log_state.hpp +++ b/include/indentlog/log_state.hpp @@ -223,8 +223,7 @@ namespace xo { */ this->ss_ << "(" - << with_color(color_spec(log_config::encoding, - log_config::nesting_level_color), + << with_color(log_config::nesting_level_color, this->nesting_level_) << ")"; }