Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding on demand truncation for basic file sinks #3280

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unnecessary file close
  • Loading branch information
matteodelseppia committed Dec 2, 2024
commit e79d95925a31a277061f5cfc90fb16d53270159a
1 change: 0 additions & 1 deletion include/spdlog/sinks/basic_file_sink-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ SPDLOG_INLINE const filename_t &basic_file_sink<Mutex>::filename() const {

template <typename Mutex>
SPDLOG_INLINE void basic_file_sink<Mutex>::truncate() {
file_helper_.close();
file_helper_.reopen(true);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be locked using the mutex in the base class. See other sinks for example code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gosh, sorry for that. Updated.

}

Expand Down
Loading