Skip to content

Commit

Permalink
prevent initializing glog twice
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Oct 23, 2023
1 parent 63886fb commit 0122439
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rime/setup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ RIME_API void SetupLogging(const char* app_name,
// Do not allow other users to read/write log files created by current
// process.
FLAGS_logfile_mode = 0600;
google::InitGoogleLogging(app_name);
if (google::IsGoogleLoggingInitialized()) {
LOG(WARNING) << "Glog is already initialized.";
} else {
google::InitGoogleLogging(app_name);
}
#endif // RIME_ENABLE_LOGGING
}

Expand Down

0 comments on commit 0122439

Please sign in to comment.