From 8268eef8b288c62a9d5552e481567e4315bf06cb Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 16 Sep 2023 15:20:29 -0400 Subject: [PATCH] nestlog: fix defualt indenting --- include/nestlog/log_config.hpp | 4 ++-- include/nestlog/log_state.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/nestlog/log_config.hpp b/include/nestlog/log_config.hpp index 00e49249..76ecf63f 100644 --- a/include/nestlog/log_config.hpp +++ b/include/nestlog/log_config.hpp @@ -19,7 +19,7 @@ namespace xo { static bool time_local_flag; /* true to log time-of-day with microsecond precision; false for millisecond precision */ static bool time_usec_flag; - /* spaces per nesting level */ + /* spaces per nesting level. 0 -> no indenting */ static std::uint32_t indent_width; /* max #of spaces to introduce when indenting */ static std::uint32_t max_indent_width; @@ -62,7 +62,7 @@ namespace xo { template std::uint32_t - log_config_impl::indent_width = 1; + log_config_impl::indent_width = 2; template std::uint32_t diff --git a/include/nestlog/log_state.hpp b/include/nestlog/log_state.hpp index 9bf6fefb..01566380 100644 --- a/include/nestlog/log_state.hpp +++ b/include/nestlog/log_state.hpp @@ -229,7 +229,7 @@ namespace xo { << ")"; } - if (log_config::indent_width > 1) + if (log_config::indent_width > 0) this->ss_ << ' '; /* scope name - note no trailing newline; expect .preamble()/.postamble() caller to supply */