Skip to content

Commit c737a90

Browse files
author
sl
committed
[Bug] fixed bug of master not using glog actually
1 parent 496cecd commit c737a90

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mooncake-store/src/master.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include <gflags/gflags.h>
2+
#include <glog/logging.h>
23

34
#include <chrono> // For std::chrono
45
#include <memory> // For std::unique_ptr
@@ -357,10 +358,25 @@ std::unique_ptr<mooncake::HttpMetadataServer> StartHttpMetadataServer(
357358
}
358359
}
359360

361+
class GlogRAII {
362+
public:
363+
GlogRAII(const char* argv0) {
364+
google::InitGoogleLogging(argv0);
365+
}
366+
367+
~GlogRAII() {
368+
LOG(INFO) << "Shutting down glog gracefully";
369+
google::ShutdownGoogleLogging();
370+
}
371+
};
372+
360373
int main(int argc, char* argv[]) {
361374
easylog::set_min_severity(easylog::Severity::WARN);
362375
// Initialize gflags
363376
gflags::ParseCommandLineFlags(&argc, &argv, true);
377+
378+
GlogRAII glogRAII(argv[0]);
379+
364380
// Initialize the master configuration
365381
mooncake::MasterConfig master_config;
366382
std::string conf_path = FLAGS_config_path;

0 commit comments

Comments
 (0)