Skip to content

Commit 2ec78bc

Browse files
authored
Fix glog may buffer the stdout's output (#2131)
1 parent 4a8fb4b commit 2ec78bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cli/main.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static void InitGoogleLog(const Config *config) {
107107
}
108108
FLAGS_stderrthreshold = google::ERROR;
109109
FLAGS_logtostdout = true;
110+
std::setbuf(stdout, nullptr);
110111
} else {
111112
FLAGS_log_dir = config->log_dir + "/";
112113
if (config->log_retention_days != -1) {

0 commit comments

Comments
 (0)