mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove incomplete non-blocking logger functionality
This commit is contained in:
parent
a24398b647
commit
d9452d3ab3
2 changed files with 1 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue