From 12656378755e843bd795e4d6b1fe3db669f411aa Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 24 Aug 2020 20:47:06 -0700 Subject: Stop doing weird things with STDOUT This means we get output when going to logfiles, while daemonized or when sending to pipes. Piping trace output to grep/less is why I consider the current behavior broken and this to be a bugfix. Since this is all debug/trace logging tweaking this should not be impacting anyone's running systems (https://xkcd.com/1172/). Under ideal conditions we should probably figure out some way to send output through the logger when trace is enabled and there's no STDOUT, but this is probably a VERY unlikely use case and is just not super easy. And daemonized trace logging of live stdout to a logfile will actually work correctly if someone is using something like systemd and just using STDOUT logging like it is the 21st century. Signed-off-by: Lamont Granquist --- lib/mixlib/shellout/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/mixlib/shellout/helper.rb b/lib/mixlib/shellout/helper.rb index d6d5963..0c041f8 100644 --- a/lib/mixlib/shellout/helper.rb +++ b/lib/mixlib/shellout/helper.rb @@ -157,7 +157,7 @@ module Mixlib end def __io_for_live_stream - if STDOUT.tty? && !__config[:daemon] && __log.trace? + if !STDOUT.closed? && __log.trace? STDOUT else nil -- cgit v1.2.1