Class: Groonga::FileQueryLogger

Inherits:
QueryLogger show all
Defined in:
lib/groonga/query-logger.rb

Instance Method Summary collapse

Methods inherited from QueryLogger

#log, log, path, path=, register, reopen, rotate_threshold_size, rotate_threshold_size=, unregister

Constructor Details

#initialize(file_name) ⇒ FileQueryLogger

Returns a new instance of FileQueryLogger



116
117
118
119
120
# File 'lib/groonga/query-logger.rb', line 116

def initialize(file_name)
  super()
  @file = nil
  @file_name = file_name
end

Instance Method Details

#finObject



130
131
132
133
134
135
# File 'lib/groonga/query-logger.rb', line 130

def fin
  guard do
    return unless @file
    @file.close
  end
end

#reopenObject



122
123
124
125
126
127
128
# File 'lib/groonga/query-logger.rb', line 122

def reopen
  guard do
    return unless @file
    @file.close
    @file = nil
  end
end