Skip to content

Commit 283e405

Browse files
author
shshshsh
committed
Switch stdout to line buffering
Use line buffering (instead of block buffering) so that messages arrive immediately in systemd-journald, tail -f debug.log, and the like.
1 parent 2653e00 commit 283e405

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/init.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#endif
2626

2727
#include <stdint.h>
28+
#include <stdio.h>
2829

2930
#ifndef WIN32
3031
#include <signal.h>
@@ -530,6 +531,7 @@ bool AppInit2(boost::thread_group& threadGroup)
530531
fServer = GetBoolArg("-server", false);
531532
fPrintToConsole = GetBoolArg("-printtoconsole", false);
532533
fLogTimestamps = GetBoolArg("-logtimestamps", true);
534+
setvbuf(stdout, NULL, _IOLBF, 0);
533535
#ifdef ENABLE_WALLET
534536
bool fDisableWallet = GetBoolArg("-disablewallet", false);
535537
#endif

0 commit comments

Comments
 (0)