indentlog: refactor: with_color() uses color_spec

This commit is contained in:
Roland Conybeare 2023-09-18 12:34:17 -04:00
commit a9777a7ddf
5 changed files with 8 additions and 8 deletions

View file

@ -25,7 +25,7 @@ namespace xo {
void print_code_location(std::ostream & os) const {
os << "["
<< with_color(encoding_, color_, basename(file_))
<< with_color(color_spec(encoding_, color_), basename(file_))
<< ":"
<< line_
<< "]";

View file

@ -154,8 +154,8 @@ namespace xo {
} /*with_ansi_color*/
template <typename Contents>
color_impl<Contents> with_color(color_encoding encoding, std::uint32_t color, Contents && contents) {
return color_impl<Contents>(CF_All, color_spec(encoding, color), std::forward<Contents>(contents));
color_impl<Contents> with_color(color_spec spec, Contents && contents) {
return color_impl<Contents>(CF_All, spec, std::forward<Contents>(contents));
} /*with_color*/
inline color_impl<int>

View file

@ -250,10 +250,10 @@ namespace xo {
switch(fn.style()) {
case FS_Literal:
os << with_color(fn.encoding(), fn.color(), fn.pretty());
os << with_color(color_spec(fn.encoding(), fn.color()), fn.pretty());
break;
case FS_Pretty:
os << "[" << with_color(fn.encoding(), fn.color(), fn.pretty()) << "]";
os << "[" << with_color(color_spec(fn.encoding(), fn.color()), fn.pretty()) << "]";
break;
case FS_Simple:
os << color_on(fn.encoding(), fn.color());

View file

@ -223,8 +223,8 @@ namespace xo {
*/
this->ss_
<< "("
<< with_color(log_config::encoding,
log_config::nesting_level_color,
<< with_color(color_spec(log_config::encoding,
log_config::nesting_level_color),
this->nesting_level_)
<< ")";
}

View file

@ -96,7 +96,7 @@ namespace xo {
if(PrefixSpace)
s << " ";
s << with_color(tag_config::encoding, tag_config::tag_color, concat((char const *)":", tag.name()))
s << with_color(color_spec(tag_config::encoding, tag_config::tag_color), concat((char const *)":", tag.name()))
<< " " << unq(tag.value());
return s;