indentlog: refactor: log_config.code_location_color uses color_spec

This commit is contained in:
Roland Conybeare 2023-09-18 12:49:45 -04:00
commit 62d2ac2766
3 changed files with 5 additions and 5 deletions

View file

@ -34,7 +34,7 @@ main(int argc, char ** argv) {
log_config::encoding = CE_Xterm;
log_config::function_entry_color = 69;
log_config::function_exit_color = 70;
log_config::code_location_color = 166;
log_config::code_location_color = color_spec::xterm(166);
int n = 3;

View file

@ -41,7 +41,7 @@ namespace xo {
/* when .location_enabled, write [file:line] starting this many chars from left margin */
static std::uint32_t location_tab;
/* color to use for code location */
static std::uint32_t code_location_color;
static color_spec code_location_color;
}; /*log_config_impl*/
template <typename Tag>
@ -101,8 +101,8 @@ namespace xo {
log_config_impl<Tag>::location_tab = 80;
template <typename Tag>
std::uint32_t
log_config_impl<Tag>::code_location_color = 31;
color_spec
log_config_impl<Tag>::code_location_color = color_spec::red();
using log_config = log_config_impl<class log_config_tag>;
} /*namespace xo*/

View file

@ -348,7 +348,7 @@ namespace xo {
std::stringstream ss;
ss << code_location(this->file_, this->line_,
color_spec(log_config::encoding, log_config::code_location_color));
log_config::code_location_color);
std::string ss_str = std::move(ss.str()); /*c++20*/
sbuf2->sputn(ss_str.c_str(), ss_str.size());