diff options
Diffstat (limited to 'lib/logger/log_device.rb')
-rw-r--r-- | lib/logger/log_device.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/logger/log_device.rb b/lib/logger/log_device.rb index 96d77b7b6a..84277a2656 100644 --- a/lib/logger/log_device.rb +++ b/lib/logger/log_device.rb @@ -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) @@ -135,7 +137,7 @@ class Logger end end - if /mswin|mingw|cygwin/ =~ RUBY_PLATFORM + if /mswin|mingw|cygwin/ =~ RbConfig::CONFIG['host_os'] def lock_shift_log yield end |