Skip to content

Commit

Permalink
refactor: initialize google logger after parsing options (#2664)
Browse files Browse the repository at this point in the history
Co-authored-by: Twice <[email protected]>
  • Loading branch information
aleksraiden and PragmaTwice authored Nov 16, 2024
1 parent e26c54a commit 185bfc6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cli/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ static void InitGoogleLog(const Config *config) {
int main(int argc, char *argv[]) {
srand(static_cast<unsigned>(util::GetTimeStamp()));

google::InitGoogleLogging("kvrocks");
auto glog_exit = MakeScopeExit(google::ShutdownGoogleLogging);

evthread_use_pthreads();
auto event_exit = MakeScopeExit(libevent_global_shutdown);

Expand All @@ -141,6 +138,8 @@ int main(int argc, char *argv[]) {

crc64_init();
InitGoogleLog(&config);
google::InitGoogleLogging("kvrocks");
auto glog_exit = MakeScopeExit(google::ShutdownGoogleLogging);
LOG(INFO) << "kvrocks " << PrintVersion;
// Tricky: We don't expect that different instances running on the same port,
// but the server use REUSE_PORT to support the multi listeners. So we connect
Expand Down

0 comments on commit 185bfc6

Please sign in to comment.