From 921da6aac62baf1944c8c6b3c758688080b32125 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 18 Sep 2023 12:39:55 -0400 Subject: [PATCH] indentlog: refactor: color_spec arg to function_name_impl<> --- include/indentlog/function.hpp | 6 +++--- include/indentlog/log_state.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/indentlog/function.hpp b/include/indentlog/function.hpp index 65ee5ae5..d79417e0 100644 --- a/include/indentlog/function.hpp +++ b/include/indentlog/function.hpp @@ -26,12 +26,12 @@ namespace xo { * 31 = red */ function_name_impl(function_style style, - color_encoding encoding, - std::uint32_t color, + color_spec spec, std::string_view pretty) - : style_{style}, color_spec_(encoding, color), pretty_{pretty} {} + : style_{style}, color_spec_{spec}, pretty_{pretty} {} function_style style() const { return style_; } + color_spec const & spec() const { return color_spec_; } color_encoding encoding() const { return color_spec_.encoding(); } std::uint32_t color() const { return color_spec_.code(); } std::string_view const & pretty() const { return pretty_; } diff --git a/include/indentlog/log_state.hpp b/include/indentlog/log_state.hpp index 814bf070..ad92c08e 100644 --- a/include/indentlog/log_state.hpp +++ b/include/indentlog/log_state.hpp @@ -233,7 +233,7 @@ namespace xo { this->ss_ << ' '; /* scope name - note no trailing newline; expect .preamble()/.postamble() caller to supply */ - this->ss_ << function_name(style, encoding, fn_color, name1) << name2; + this->ss_ << function_name(style, color_spec(encoding, fn_color), name1) << name2; } /*entryexit_aux*/ template