diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-18 16:36:51 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-18 16:36:51 -0700 |
commit | 6f91c901971c4f3ad3bfbe389c23f72cc04ef138 (patch) | |
tree | 613b24680bcdb02dfa2ff1cfb7672c67eb1058ee | |
parent | 83fef3b411ba66134287d1cbd6a56df2179d3512 (diff) | |
download | chef-lcg/fix-dup-logger-again-again.tar.gz |
Fix dup logger bugs againlcg/fix-dup-logger-again-again
See the inline comments attempting to explain my logic
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/application.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 81637eabb8..7f9dd426a8 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -202,10 +202,12 @@ class Chef end end - # Based on config and whether or not STDOUT is a tty, should we setup a - # secondary logger for stdout? + # we do NOT want an addition logger if: + # - log_location is the default (nobody has redirected to logfile or syslogd or whatevs) + # - STDOUT is closed + # - we are running explicitly daemonized def want_additional_logger? - Chef::Config.is_default?(:log_location) && Chef::Config[:log_location].tty? && !Chef::Config[:daemonize] + !(Chef::Config.is_default?(:log_location) || STDOUT.closed? || Chef::Config[:daemonize]) end def configure_stdout_logger |