minor renaming

This commit is contained in:
gabime 2018-04-06 03:22:27 +03:00
parent 2f7fdf2663
commit 3452892f76
1 changed files with 7 additions and 6 deletions

View File

@ -421,15 +421,15 @@ private:
std::string _str;
};
// set the color range. expect it to be in the form of "%^colored text%$"
class start_color_formatter SPDLOG_FINAL : public flag_formatter
// mark the color range. expect it to be in the form of "%^colored text%$"
class color_start_formatter SPDLOG_FINAL : public flag_formatter
{
void format(details::log_msg &msg, const std::tm &) override
{
msg.color_range_start = msg.formatted.size();
}
};
class stop_color_formatter SPDLOG_FINAL : public flag_formatter
class color_stop_formatter SPDLOG_FINAL : public flag_formatter
{
void format(details::log_msg &msg, const std::tm &) override
{
@ -438,7 +438,6 @@ class stop_color_formatter SPDLOG_FINAL : public flag_formatter
};
// Full info formatter
// pattern: [%Y-%m-%d %H:%M:%S.%e] [%n] [%l] %v
class full_formatter SPDLOG_FINAL : public flag_formatter
{
@ -667,11 +666,13 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
case ('i'):
_formatters.emplace_back(new details::i_formatter());
break;
case ('^'):
_formatters.emplace_back(new details::start_color_formatter());
_formatters.emplace_back(new details::color_start_formatter());
break;
case ('$'):
_formatters.emplace_back(new details::stop_color_formatter());
_formatters.emplace_back(new details::color_stop_formatter());
break;
default: // Unknown flag appears as is