зеркало из https://github.com/github/ruby.git
[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:
Родитель
2efaa80523
Коммит
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче