vendor/bundle/ruby/2.6.0/gems/lumberjack-1.2.8/lib/lumberjack/logger.rb
# Create a thread that will periodically call flush.
Create a thread that will periodically call flush.
Create a thread that will periodically call flush .
def create_flusher_thread(flush_seconds) 
      if flush_seconds > 0
        begin
          logger = self
          Thread.new do
            until closed?
              begin
                sleep(flush_seconds)
                logger.flush if Time.now - logger.last_flushed_at >= flush_seconds
              rescue => e
                warn("Error flushing log: #{e.inspect}")
              end
            end
          end
        end
      end
    end
def create_flusher_thread ( flush_seconds ) if flush_seconds > 0 begin logger = self Thread . new do until closed? begin sleep ( flush_seconds ) logger . flush if Time . now - logger . last_flushed_at >= flush_seconds rescue => e warn ( "Error flushing log: #{e.inspect}" ) end end end end end end
Create a thread that will periodically call flush.
Create a thread that will periodically call flush .
#:nodoc:
flush_seconds