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

add max files for rotating days #1394

Merged
merged 3 commits into from
Jan 19, 2020
Merged

add max files for rotating days #1394

merged 3 commits into from
Jan 19, 2020

Conversation

ruoshui1314
Copy link

No description provided.

@ruoshui1314
Copy link
Author

It does not try to check files that exists in disk when initialization.
The patch will try to search files when service is started or restarted and also export max_files attribute into interface.

using details::os::path_exists;

filenames_q_ = details::circular_q<filename_t>(static_cast<size_t>(max_files_));
std::vector<filename_t> filenames;
Copy link
Owner

Choose a reason for hiding this comment

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

This vector can be avoided. Just pushback to the q instead of accumulating in filenames.

Copy link
Author

Choose a reason for hiding this comment

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

I think it will remove the latest log file when rotating if push back to the q directly.
I am confused whether It leads to an mistake that could not get the previews log files when service or process is restarted.
In this way it will never remove any previews files.
@gabime

Copy link
Owner

Choose a reason for hiding this comment

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

right

include/spdlog/sinks/daily_file_sink.h Outdated Show resolved Hide resolved
@gabime gabime merged commit 0a36828 into gabime:v1.x Jan 19, 2020
bachittle pushed a commit to bachittle/spdlog that referenced this pull request Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants