LogCleaner: Fix relative paths and add a new test#754
LogCleaner: Fix relative paths and add a new test#754sergiud merged 1 commit intogoogle:masterfrom aesophor:fix-relative-paths
Conversation
Codecov Report
@@ Coverage Diff @@
## master #754 +/- ##
==========================================
+ Coverage 72.65% 72.74% +0.09%
==========================================
Files 17 17
Lines 3211 3211
==========================================
+ Hits 2333 2336 +3
+ Misses 878 875 -3
Continue to review full report at Codecov.
|
What does this mean exactly, i.e., what is the intended behavior? |
I've updated the description of this PR. if the user sets the log destination using a relative path (e.g., "testdir/"), then the log cleaner will scan "." for logs instead of "testdir/" |
sergiud
left a comment
There was a problem hiding this comment.
Could you please also rebase onto current master and squash all the commits?
|
I've squashed all the commits into one, and renamed |
Signed-off-by: Marco Wang <m.aesophor@gmail.com>
|
Thanks! |
Overview
Currently, if the user sets the log destination using a relative path (e.g., "testdir/"), then the log cleaner will scan "." for logs instead of "testdir/". This PR fixes the problem and adds a new test.
Root Cause
posofstring::find_last_ofindicates the position at which the search is to finish.string::nposinstead of0at line 1333.glog/src/logging.cc
Lines 1333 to 1341 in 3362cc6
Fix
string::nposinstead of0at line 1333.src/cleanup_with_prefix_unittest.cc)