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: opencurve#2811

Signed-off-by: NaturalSelect <2145973003@qq.com>
  • Loading branch information
NaturalSelect committed Nov 7, 2023
1 parent c63296b commit 79fa08c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions curvefs/src/mds/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ int main(int argc, char **argv) {
}

// initialize logging module
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

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

// initialize logging module
FLAGS_logtostderr = false;
google::InitGoogleLogging(argv[0]);

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

// 初始化日志模块
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

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

// initialize logging module
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

// reset SIGPIPE handler
Expand Down
1 change: 1 addition & 0 deletions src/snapshotcloneserver/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ int main(int argc, char **argv) {
LoadConfigFromCmdline(conf.get());
conf->PrintConfig();
conf->ExposeMetric("snapshot_clone_server_config");
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);
snapshotcloneserver_main(conf);
}
Expand Down

0 comments on commit 79fa08c

Please sign in to comment.