This is an automated email from the ASF dual-hosted git repository.
hulk pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 185bfc6c refactor: initialize google logger after parsing options
(#2664)
185bfc6c is described below
commit 185bfc6cd259163733fa0342803de0b597ce0539
Author: Aleks Lozovyuk <[email protected]>
AuthorDate: Sat Nov 16 02:51:32 2024 +0200
refactor: initialize google logger after parsing options (#2664)
Co-authored-by: Twice <[email protected]>
---
src/cli/main.cc | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/cli/main.cc b/src/cli/main.cc
index 3eaf4b13..2ce5f013 100644
--- a/src/cli/main.cc
+++ b/src/cli/main.cc
@@ -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);
@@ -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