Skip to content

Commit

Permalink
CleanOldLogFiles doesn't scan cwd when no log_dir (rime#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored and graphemecluster committed Oct 10, 2023
1 parent 0cecd77 commit 7d1021c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/rime/lever/deployment_tasks.cc
Expand Up @@ -642,7 +642,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 7d1021c

Please sign in to comment.