Permalink
Browse files

Remove incomplete non-blocking logger functionality

  • Loading branch information...
1 parent a24398b commit d9452d3ab3063c5e96dfd80cf6056c49192081b3 @NZKoz NZKoz committed Jul 29, 2008
Showing with 1 addition and 14 deletions.
  1. +1 −13 activesupport/lib/active_support/buffered_logger.rb
  2. +0 −1 railties/lib/initializer.rb
@@ -39,7 +39,6 @@ def initialize(log, level = DEBUG)
@level = level
@buffer = []
@auto_flushing = 1
- @no_block = false
@guard = Mutex.new
if log.respond_to?(:write)
@@ -55,12 +54,6 @@ def initialize(log, level = DEBUG)
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 @@ def flush
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
@@ -408,7 +408,6 @@ def initialize_logger
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)

0 comments on commit d9452d3

Please sign in to comment.