summaryrefslogtreecommitdiff
path: root/library/ColorText.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-15 11:07:43 +0400
committerAlexander Gavrilov2012-03-15 11:07:43 +0400
commite7851f5abdd1a84d29020f2789efc0f932284bf0 (patch)
treed5912bf9ba41cb9fcc018540f4cad1972fb3a975 /library/ColorText.cpp
parent560e977f0589ac1c0feb6ea825d20d351e325826 (diff)
downloaddfhack-e7851f5abdd1a84d29020f2789efc0f932284bf0.tar.gz
dfhack-e7851f5abdd1a84d29020f2789efc0f932284bf0.tar.bz2
dfhack-e7851f5abdd1a84d29020f2789efc0f932284bf0.tar.xz
Improve support for void RPC functions, dfhack-run, etc.
Diffstat (limited to 'library/ColorText.cpp')
-rw-r--r--library/ColorText.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/ColorText.cpp b/library/ColorText.cpp
index c399504b..5d6e1d82 100644
--- a/library/ColorText.cpp
+++ b/library/ColorText.cpp
@@ -56,6 +56,8 @@ using namespace DFHack;
#include "tinythread.h"
using namespace tthread;
+bool color_ostream::log_errors_to_stderr = false;
+
void color_ostream::flush_buffer(bool flush)
{
auto buffer = buf();
@@ -122,7 +124,8 @@ void color_ostream::vprinterr(const char *format, va_list args)
{
color_value save = cur_color;
- fprintf(stderr, format, args);
+ if (log_errors_to_stderr)
+ fprintf(stderr, format, args);
color(COLOR_LIGHTRED);
vprint(format, args);