This is an automated email from the ASF dual-hosted git repository.

aleksraiden pushed a commit to branch aleksraiden-glog-new
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/aleksraiden-glog-new by this 
push:
     new 3fcf43e5 Fix clang-format
3fcf43e5 is described below

commit 3fcf43e5c0bf0be4a5a9128b459e9ac519181439
Author: Aleks Lozovyuk <[email protected]>
AuthorDate: Thu Nov 14 11:44:35 2024 +0200

    Fix clang-format
---
 src/cli/main.cc | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/cli/main.cc b/src/cli/main.cc
index efe1c542..2ce5f013 100644
--- a/src/cli/main.cc
+++ b/src/cli/main.cc
@@ -31,7 +31,6 @@
 #include <ostream>
 
 #include "daemon_util.h"
-#include "glog/log_severity.h"
 #include "io_util.h"
 #include "pid_util.h"
 #include "scope_exit.h"
@@ -101,7 +100,7 @@ static void InitGoogleLog(const Config *config) {
 
   if (util::EqualICase(config->log_dir, "stdout")) {
     for (int level = google::INFO; level <= google::FATAL; level++) {
-      google::SetLogDestination(static_cast<google::LogSeverity>(level), "");
+      google::SetLogDestination(level, "");
     }
     FLAGS_stderrthreshold = google::ERROR;
     FLAGS_logtostdout = true;
@@ -109,7 +108,7 @@ static void InitGoogleLog(const Config *config) {
   } else {
     FLAGS_log_dir = config->log_dir + "/";
     if (config->log_retention_days != -1) {
-      google::EnableLogCleaner(std::chrono::hours(24) * 
config->log_retention_days);
+      google::EnableLogCleaner(config->log_retention_days);
     }
   }
 }
@@ -117,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);
 
@@ -142,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

Reply via email to