From 2490dd2a5bdeab8bdad828f5d08ed5a1ac7f8a4d Mon Sep 17 00:00:00 2001 From: David Dollar Date: Sun, 29 Jan 2012 00:09:44 -0500 Subject: [PATCH] put an entire line of output inside a single mutex so we don't cross the streams --- lib/foreman/engine.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/foreman/engine.rb b/lib/foreman/engine.rb index ff23126..deb1de4 100644 --- a/lib/foreman/engine.rb +++ b/lib/foreman/engine.rb @@ -124,11 +124,12 @@ private ###################################################################### end def info(message, name="system", color=Term::ANSIColor.white) - print color - print "#{Time.now.strftime("%H:%M:%S")} #{pad_process_name(name)} | " - print Term::ANSIColor.reset - print message.chomp - puts "" + output = "" + output += color + output += "#{Time.now.strftime("%H:%M:%S")} #{pad_process_name(name)} | " + output += Term::ANSIColor.reset + output += message.chomp + puts output end def print(message=nil)