summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2020-08-24 20:47:06 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2020-08-24 20:47:06 -0700
commit12656378755e843bd795e4d6b1fe3db669f411aa (patch)
tree1497d36162a5fa06d3a1c9f9ff599b78e3761602
parent4e7a63686c88a3650d893397f723f0fa99343d28 (diff)
downloadmixlib-shellout-lcg/shellout-trace-logging.tar.gz
Stop doing weird things with STDOUTlcg/shellout-trace-logging
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 <lamont@scriptkiddie.org>
-rw-r--r--lib/mixlib/shellout/helper.rb2
1 files changed, 1 insertions, 1 deletions
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