We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a361493 commit dde7152Copy full SHA for dde7152
1 file changed
include/spdlog/sinks/rotating_file_sink-inl.h
@@ -115,10 +115,11 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::sink_it_(const details::log_msg &m
115
// we only check the real size when new_size > max_size_ because it is relatively expensive.
116
if (new_size > max_size_) {
117
file_helper_.flush();
118
- if (file_helper_.size() > 0) {
+
119
+ auto size = file_helper_.size();
120
+ if (size > 0) {
121
rotate_();
- current_size_ = file_helper_.size();
- new_size = formatted.size();
122
+ current_size_ = size;
123
}
124
125
file_helper_.write(formatted);
0 commit comments