From 451af05481a134727dfd4801f243d1ff70d2b77a Mon Sep 17 00:00:00 2001 From: nrakochy Date: Sat, 19 Mar 2016 10:29:47 -0500 Subject: [PATCH] Fixed SystemCallError for Windows path --- lib/sidekiq/logging.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sidekiq/logging.rb b/lib/sidekiq/logging.rb index 78b5f82c..500887ea 100644 --- a/lib/sidekiq/logging.rb +++ b/lib/sidekiq/logging.rb @@ -47,7 +47,8 @@ module Sidekiq end def self.logger=(log) - @logger = (log ? log : Logger.new('/dev/null')) + null_path = (File.exists?('/dev/null') ? '/dev/null' : 'nul') + @logger = (log ? log : Logger.new(null_path)) end # This reopens ALL logfiles in the process that have been rotated