diff options
author | Nolan Davidson <ndavidson@chef.io> | 2018-07-03 11:40:59 -0400 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-05 17:15:22 -0700 |
commit | 1e241b3f4327dfad0c26d141fe64eacd1d89494b (patch) | |
tree | 054ed4f94ebbd392001bda42b3dfb189f9838cb5 | |
parent | a8f0583ce244896113f030564d204e4969b2c989 (diff) | |
download | chef-1e241b3f4327dfad0c26d141fe64eacd1d89494b.tar.gz |
Adding log_location_default? method
Checking the configurable for `:log_location` and comparing to the
current setting. Calling `.inspect` on both to get a string
representation of IO:STDOUT, as they have different object IDs and fail
a direct comparison.
Signed-off-by: Nolan Davidson <ndavidson@chef.io>
-rw-r--r-- | lib/chef/application.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 3d7f1fd4f2..9df8de156a 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -205,7 +205,11 @@ class Chef # Based on config and whether or not STDOUT is a tty, should we setup a # secondary logger for stdout? def want_additional_logger? - ( Chef::Config[:log_location] != STDOUT ) && STDOUT.tty? && !Chef::Config[:daemonize] + ( !log_location_default? ) && STDOUT.tty? && !Chef::Config[:daemonize] + end + + def log_location_default? + Chef::Config.configurables[:log_location].instance_variable_get(:@default_value).inspect == Chef::Config[:log_location].inspect end def configure_stdout_logger |