From cb3fc22ac1a95eda0843aa641720b52063c3b74c Mon Sep 17 00:00:00 2001 From: Alessandro Da Rugna Date: Sun, 29 Oct 2017 21:02:33 +0100 Subject: add option: flush stdout Added the option to forcefully flush STDOUT, which may be useful when running the miner through a pipe instead than a shell. If STDOUT is a shell, it's unbuffered by default. If STDOUT is a pipe, it's buffered by default. --- xmrstak/misc/console.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xmrstak/misc/console.hpp') diff --git a/xmrstak/misc/console.hpp b/xmrstak/misc/console.hpp index 4d5be78..97e86bd 100644 --- a/xmrstak/misc/console.hpp +++ b/xmrstak/misc/console.hpp @@ -35,6 +35,7 @@ public: }; inline void set_verbose_level(size_t level) { verbose_level = (verbosity)level; } + inline void set_flush_stdout(bool status) { b_flush_stdout = status; } void print_msg(verbosity verbose, const char* fmt, ...); void print_str(const char* str); bool open_logfile(const char* file); @@ -44,6 +45,7 @@ private: std::mutex print_mutex; verbosity verbose_level; + bool b_flush_stdout; FILE* logfile; }; -- cgit v1.1