Skip to content

Commit

Permalink
prevent initializing glog twice (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Jun 18, 2024
1 parent af97049 commit 79dda08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Build dependencies
- compiler with C++17 support
- cmake>=3.12
- libboost>=1.74
- libglog (optional)
- libglog>=0.7 (optional)
- libleveldb
- libmarisa
- libopencc>=1.0.2
Expand Down
6 changes: 5 additions & 1 deletion src/rime/setup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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 79dda08

Please sign in to comment.