-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
src/logging.cc: encapsulate log cleaner, match logfile with <base_filename_><date>-<time>.<pid> #502
Conversation
1b56ad7
to
7764e4a
Compare
@cswuyg Could you please review the changes? |
@sergiud I've been using this patch in my own projects for a week and it seems to work well. Tested on both Linux and Windows. |
Please don't merge it yet, I've found a potential bug: Currently I'm checking if a file is a glog's logfile by checking if its filename starts with base_filename_, but this might also delete non-glog logfiles. I should make sure the entire filename matches the format of a glog's filename. |
b27370a
to
36fa99b
Compare
@sergiud I've revised the patch and re-tested it. |
Please resolve the conflict. |
@sergiud I've resolved the conflict. Thanks! |
Previously log cleaner could be broken if users use
SetLogDestination()
to set a custombase_filename_
, as discussed here: #432 (comment)This PR fixes this bug by checking if a log's filename starts with
base_filename_
.