diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index cd3e702b..e48f8272 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -245,7 +245,7 @@ inline size_t filesize(FILE *f) } #else // unix 32 bits or cygwin struct stat st; - + if (fstat(fd, &st) == 0) { return static_cast(st.st_size); diff --git a/include/spdlog/details/pattern_formatter_impl.h b/include/spdlog/details/pattern_formatter_impl.h index b801221b..e3d70878 100644 --- a/include/spdlog/details/pattern_formatter_impl.h +++ b/include/spdlog/details/pattern_formatter_impl.h @@ -480,11 +480,10 @@ class full_formatter SPDLOG_FINAL : public flag_formatter msg.formatted << '['; // wrap the level name with color - msg.color_range_start = msg.formatted.size(); - msg.formatted << level::to_str(msg.level); - msg.color_range_end = msg.formatted.size(); + msg.color_range_start = msg.formatted.size(); + msg.formatted << level::to_str(msg.level); + msg.color_range_end = msg.formatted.size(); msg.formatted << "] " << fmt::StringRef(msg.raw.data(), msg.raw.size()); - } };