From 4fedc8521ced3f1466001f525fdb1507501dfa78 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Mon, 29 Apr 2013 09:53:33 -0700 Subject: [PATCH] ensure stdout is flushed immediately during pretty_print --- Changes | 1 + lib/Daemon/Control.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/Changes b/Changes index daf4cf6..a291560 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,7 @@ every second if the daemon has terminated rather than waiting for the full kill_timeout duration * new option: prereq_no_process + * stdout is flushed immediately when diagnostic output is printed 0.001000 2013-02-26 SymKat * fixed a warning on "uninitialized value $called_with in substitution" diff --git a/lib/Daemon/Control.pm b/lib/Daemon/Control.pm index 936cc2b..f8ed767 100644 --- a/lib/Daemon/Control.pm +++ b/lib/Daemon/Control.pm @@ -352,6 +352,7 @@ sub pretty_print { $color ||= "green"; # Green is no color. my $code = $self->color_map->{$color} ||= "32"; # Green is invalid. + local $| = 1; printf( "%-49s %30s\n", $self->name, "\033[$code" ."m[$message]\033[0m" ); }