Skip to content

Commit 07f74a0

Browse files
committed
chore: flush the log every line
1 parent c9d54d9 commit 07f74a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "list_topics.h"
2121
#include <argparse/argparse.hpp>
2222
#include <array>
23+
#include <cstdio>
2324
#include <cstdlib>
2425
#include <cstring>
2526
#include <filesystem>
@@ -138,6 +139,7 @@ int main(int argc, char *argv[]) {
138139
const char *buf) {
139140
auto file = static_cast<FILE *>(rd_kafka_opaque(rk));
140141
fprintf(file, "[%d] %s: %s\n", level, fac, buf);
142+
fflush(file);
141143
});
142144
}
143145
}

0 commit comments

Comments
 (0)