[ruby/logger] Only assign to @filename
if the path is valid.
(https://github.com/ruby/logger/pull/81) https://github.com/ruby/logger/commit/b41d7c699c
This commit is contained in:
parent
2efaa80523
commit
7ab4820af7
@ -79,8 +79,10 @@ class Logger
|
||||
def set_dev(log)
|
||||
if log.respond_to?(:write) and log.respond_to?(:close)
|
||||
@dev = log
|
||||
if log.respond_to?(:path)
|
||||
@filename = log.path
|
||||
if log.respond_to?(:path) and path = log.path
|
||||
if File.exist?(path)
|
||||
@filename = path
|
||||
end
|
||||
end
|
||||
else
|
||||
@dev = open_logfile(log)
|
||||
|
Loading…
x
Reference in New Issue
Block a user