Skip to content

Commit

Permalink
fix(util): stop write log to stderr, when FLAGS_logtostderr is false
Browse files Browse the repository at this point in the history
close: #2811

Signed-off-by: NaturalSelect <[email protected]>
  • Loading branch information
NaturalSelect committed Nov 9, 2023
1 parent ba61d87 commit cd20522
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions curvefs/src/client/curve_fuse_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ int InitLog(const char *confPath, const char *argv0) {
FLAGS_vlog_level = FLAGS_v;

// initialize logging module
// NOTE: https://github.com/google/glog#setting-flags
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv0);

bool succ = InitAccessLog(FLAGS_log_dir);
Expand Down
2 changes: 2 additions & 0 deletions curvefs/src/mds/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ int main(int argc, char **argv) {
}

// initialize logging module
// NOTE: https://github.com/google/glog#setting-flags
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

conf->PrintConfig();
Expand Down
2 changes: 2 additions & 0 deletions curvefs/src/metaserver/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ int main(int argc, char **argv) {
FLAGS_vlog_level = FLAGS_v;

// initialize logging module
// NOTE: https://github.com/google/glog#setting-flags
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

conf->PrintConfig();
Expand Down
2 changes: 2 additions & 0 deletions nebd/src/part2/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ DEFINE_string(confPath, "/etc/nebd/nebd-server.conf", "nebd server conf path");
int main(int argc, char* argv[]) {
// 解析参数
google::ParseCommandLineFlags(&argc, &argv, false);
// NOTE: https://github.com/google/glog#setting-flags
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);
std::string confPath = FLAGS_confPath.c_str();

Expand Down
2 changes: 2 additions & 0 deletions src/chunkserver/chunkserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ int ChunkServer::Run(int argc, char** argv) {
LoadConfigFromCmdline(&conf);

// 初始化日志模块
// NOTE: https://github.com/google/glog#setting-flags
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

// 打印参数
Expand Down
2 changes: 2 additions & 0 deletions src/mds/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ int main(int argc, char **argv) {
}

// initialize logging module
// NOTE: https://github.com/google/glog#setting-flags
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

// reset SIGPIPE handler
Expand Down
2 changes: 2 additions & 0 deletions src/snapshotcloneserver/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ int main(int argc, char **argv) {
LoadConfigFromCmdline(conf.get());
conf->PrintConfig();
conf->ExposeMetric("snapshot_clone_server_config");
// NOTE: https://github.com/google/glog#setting-flags
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);
snapshotcloneserver_main(conf);
}
Expand Down

0 comments on commit cd20522

Please sign in to comment.