summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNolan Davidson <ndavidson@chef.io>2018-07-03 11:40:59 -0400
committerBryan McLellan <btm@loftninjas.org>2018-07-10 12:29:36 -0400
commit62af0026419e0d066153be8eb04569ce0aefb1b8 (patch)
treeb0c56c4038bc33ab4bce3f47dd82e132d2c9e7cd
parent42535b2b0327be3fb23ebf6cf581148e9591bef3 (diff)
downloadchef-62af0026419e0d066153be8eb04569ce0aefb1b8.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.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index 6327ef0f90..d8f8402aa9 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -177,7 +177,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