1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/logger] Set filename when initializing logger with a File object

This should allow reopen to work.  Requested in ruby issue #14595.

bd367aff12
This commit is contained in:
Jeremy Evans 2019-05-16 17:35:21 -07:00 committed by Hiroshi SHIBATA
parent 2c22051b4b
commit f4064a0a0c
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 18 additions and 0 deletions

View file

@ -76,6 +76,9 @@ 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
end
else
@dev = open_logfile(log)
@dev.sync = true