Method: Logging::Appenders::StringIo#reopen

Defined in:
lib/logging/appenders/string_io.rb

#reopenObject

Reopen the underlying StringIO instance. If the instance is currently closed then it will be opened. If the instance is currently open then it will be closed and immediately opened.



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/logging/appenders/string_io.rb', line 36

def reopen
  @mutex.synchronize {
    if defined? @io and @io
      flush
      @io.close rescue nil
    end
    @io = @sio = StringIO.new
    @sio.extend IoToS
    @pos = 0
  }
  super
  self
end