method

flush

Importance_0
v3.0.0 - Show latest stable - 0 notes - Class: ActiveSupport::BufferedLogger
flush() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/buffered_logger.rb, line 101
    def flush
      @guard.synchronize do
        unless buffer.empty?
          old_buffer = buffer
          all_content = StringIO.new
          old_buffer.each do |content|
            all_content << content
          end
          @log.write(all_content.string)
        end

        # Important to do this even if buffer was empty or else @buffer will
        # accumulate empty arrays for each request where nothing was logged.
        clear_buffer
      end
    end
Register or log in to add new notes.