Skip to content

Commit

Permalink
CleanOldLogFiles doesn't scan cwd when no log_dir (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Oct 10, 2023
1 parent c34c9ea commit eb2477e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rime/lever/deployment_tasks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,15 @@ bool CleanOldLogFiles::Run(Deployer* deployer) {
string today(ymd);
DLOG(INFO) << "today: " << today;

vector<string> dirs = google::GetLoggingDirectories();
vector<string> dirs;
// Don't call GetLoggingDirectories as it contains current directory,
// which causes permission issue on Android
// https://github.com/google/glog/blob/b58718f37cf58fa17f48bf1d576974d133d89839/src/logging.cc#L2410
if (FLAGS_log_dir.empty()) {
google::GetExistingTempDirectories(&dirs);
} else {
dirs.push_back(FLAGS_log_dir);
}
DLOG(INFO) << "scanning " << dirs.size() << " temp directory for log files.";

int removed = 0;
Expand Down

0 comments on commit eb2477e

Please sign in to comment.