From 84b2f814e8dbae7ba2eb0c206d26e465d9238455 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 16 May 2015 18:23:02 -0400 Subject: [PATCH] Disable some plugin output on startup * tweak: Log tweak changes to stderr.log instead of the console * stockflow: Use "enable stockflow" instead of "stockflow enable" in dfhack.init-example --- dfhack.init-example | 2 +- plugins/tweak/tweak.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dfhack.init-example b/dfhack.init-example index 94d132756..7fb937a3b 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -218,7 +218,7 @@ enable \ # You can comment out the extension of a line. # allow the fortress bookkeeper to queue jobs through the manager -stockflow enable +enable stockflow ########### # Scripts # diff --git a/plugins/tweak/tweak.cpp b/plugins/tweak/tweak.cpp index 907c3945a..1a0249c5e 100644 --- a/plugins/tweak/tweak.cpp +++ b/plugins/tweak/tweak.cpp @@ -666,12 +666,16 @@ static void enable_hook(color_ostream &out, VMethodInterposeLinkBase &hook, vect if (vector_get(parameters, 1) == "disable") { hook.remove(); - out.print("Disabled tweak %s (%s)\n", parameters[0].c_str(), hook.name()); + fprintf(stderr, "Disabled tweak %s (%s)\n", parameters[0].c_str(), hook.name()); + fflush(stderr); } else { if (hook.apply()) - out.print("Enabled tweak %s (%s)\n", parameters[0].c_str(), hook.name()); + { + fprintf(stderr, "Enabled tweak %s (%s)\n", parameters[0].c_str(), hook.name()); + fflush(stderr); + } else out.printerr("Could not activate tweak %s (%s)\n", parameters[0].c_str(), hook.name()); } @@ -697,7 +701,8 @@ static command_result enable_tweak(string tweak, color_ostream &out, vector second; hook.enabled = state; - out.print("%s tweak %s (%s)\n", state ? "Enabled" : "Disabled", cmd.c_str(), hook.name.c_str()); + fprintf(stderr, "%s tweak %s (%s)\n", state ? "Enabled" : "Disabled", cmd.c_str(), hook.name.c_str()); + fflush(stderr); } } if (!recognized)