Reduced max padding 128=>64

This commit is contained in:
gabime 2019-06-28 01:41:11 +03:00
parent 6e83abdbf2
commit 94c2810b0a
2 changed files with 5 additions and 9 deletions

View File

@ -84,9 +84,7 @@ private:
const padding_info &padinfo_;
fmt::memory_buffer &dest_;
size_t total_pad_;
string_view_t spaces_{" "
" ",
128};
string_view_t spaces_{" ", 64};
};
class name_formatter : public flag_formatter
@ -1217,7 +1215,7 @@ SPDLOG_INLINE details::padding_info pattern_formatter::handle_padspec_(std::stri
{
using details::padding_info;
using details::scoped_pad;
const size_t max_width = 128;
const size_t max_width = 64;
if (it == end)
{
return padding_info{};

View File

@ -183,16 +183,14 @@ TEST_CASE("left_padded_huge", "[pattern_formatter]")
{
REQUIRE(
log_to_str("Some message", "[%-300n] %v", spdlog::pattern_time_type::local, "\n") ==
"[pattern_tester ]"
" Some message\n");
"[pattern_tester ] Some message\n");
}
TEST_CASE("left_padded_max", "[pattern_formatter]")
{
REQUIRE(
log_to_str("Some message", "[%-128n] %v", spdlog::pattern_time_type::local, "\n") ==
"[pattern_tester ]"
" Some message\n");
log_to_str("Some message", "[%-64n] %v", spdlog::pattern_time_type::local, "\n") ==
"[pattern_tester ] Some message\n");
}
TEST_CASE("clone-default-formatter", "[pattern_formatter]")