aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/buffered_logger.rb14
-rw-r--r--railties/lib/initializer.rb1
2 files changed, 1 insertions, 14 deletions
diff --git a/activesupport/lib/active_support/buffered_logger.rb b/activesupport/lib/active_support/buffered_logger.rb
index aec416a6d6..cedc1afe7f 100644
--- a/activesupport/lib/active_support/buffered_logger.rb
+++ b/activesupport/lib/active_support/buffered_logger.rb
@@ -39,7 +39,6 @@ module ActiveSupport
@level = level
@buffer = []
@auto_flushing = 1
- @no_block = false
@guard = Mutex.new
if log.respond_to?(:write)
@@ -55,12 +54,6 @@ module ActiveSupport
end
end
- def set_non_blocking_io
- if !RUBY_PLATFORM.match(/java|mswin/) && !(@log == STDOUT) && @log.respond_to?(:write_nonblock)
- @no_block = true
- end
- end
-
def add(severity, message = nil, progname = nil, &block)
return if @level > severity
message = (message || (block && block.call) || progname).to_s
@@ -105,12 +98,7 @@ module ActiveSupport
unless buffer.empty?
old_buffer = @buffer
@buffer = []
- text_to_write = old_buffer.join
- if @no_block
- @log.write_nonblock(text_to_write)
- else
- @log.write(text_to_write)
- end
+ @log.write(old_buffer.join)
end
end
end
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 32411e8928..782fbebec2 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -408,7 +408,6 @@ Run `rake gems:install` to install the missing gems.
logger.level = ActiveSupport::BufferedLogger.const_get(configuration.log_level.to_s.upcase)
if configuration.environment == "production"
logger.auto_flushing = false
- logger.set_non_blocking_io
end
rescue StandardError => e
logger = ActiveSupport::BufferedLogger.new(STDERR)