nestlog: bugfix: color_off() must use CE_Ansi instead of CE_None

This commit is contained in:
Roland Conybeare 2023-09-16 12:38:36 -04:00
commit 794196c3f8
2 changed files with 9 additions and 1 deletions

View file

@ -118,7 +118,7 @@ namespace xo {
inline color_impl<int>
color_off() {
/* any non-zero value works here for color */
return color_impl<int>(CF_ColorOff, CE_None, 1 /*color*/, 0);
return color_impl<int>(CF_ColorOff, CE_Ansi, 1 /*color*/, 0);
} /*color_off*/
template <typename Contents>

View file

@ -211,6 +211,14 @@ namespace xo {
this->ss_ << ee_label;
if (log_config::nesting_level_enabled) {
/* e.g.
* (^[[38;5;195m7^[[0m)
* <-----a---->b<-c->
*
* a = color on
* b = level - displayed in color
* c = color off
*/
this->ss_
<< "("
<< with_color(log_config::encoding,