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 93dd6ec
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions curvefs/src/client/curve_fuse_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ int InitLog(const char *confPath, const char *argv0) {
FLAGS_vlog_level = FLAGS_v;

// initialize logging module
FLAGS_stderrthreshold = 3;
google::InitGoogleLogging(argv0);

bool succ = InitAccessLog(FLAGS_log_dir);
Expand Down
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_stderrthreshold = 3;
google::InitGoogleLogging(argv[0]);

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

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 93dd6ec

Please sign in to comment.