lib/contrast/logger/log.rb in contrast-agent-4.6.0 vs lib/contrast/logger/log.rb in contrast-agent-4.7.0
- old
+ new
@@ -25,12 +25,11 @@
DEFAULT_LEVEL = ::Ougai::Logging::Severity::INFO
VALID_LEVELS = ::Ougai::Logging::Severity::SEV_LABEL
STDOUT_STR = 'STDOUT'
STDERR_STR = 'STDERR'
- attr_reader :previous_path,
- :previous_level
+ attr_reader :previous_path, :previous_level
def initialize
update
end
@@ -122,10 +121,12 @@
if write_permission?(path)
path
elsif write_permission?(DEFAULT_NAME)
# Log once when the path is invalid. We'll change to this path, so no
# need to log again.
- puts "[!] Unable to write to '#{ path }'. Writing to default log '#{ DEFAULT_NAME }' instead." if previous_path != DEFAULT_NAME
+ if previous_path != DEFAULT_NAME
+ puts "[!] Unable to write to '#{ path }'. Writing to default log '#{ DEFAULT_NAME }' instead."
+ end
DEFAULT_NAME
else
# Log once when the path is invalid. We'll change to this path, so no
# need to log again.
puts "[!] Unable to write to '#{ path }'. Writing to standard out instead." if previous_path != STDOUT_STR