Class: Groonga::CallbackQueryLogger

Inherits:
QueryLogger show all
Defined in:
lib/groonga/query-logger.rb,
ext/groonga/rb-grn-query-logger.c

Instance Method Summary collapse

Methods inherited from QueryLogger

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

Constructor Details

#initialize(callback) ⇒ CallbackQueryLogger

Returns a new instance of CallbackQueryLogger



151
152
153
154
# File 'lib/groonga/query-logger.rb', line 151

def initialize(callback)
  super()
  @callback = callback
end

Instance Method Details

#finObject



168
169
170
171
172
# File 'lib/groonga/query-logger.rb', line 168

def fin
  guard do
    @callback.call(:fin)
  end
end

#log(flag, timestamp, info, message) ⇒ Object



156
157
158
159
160
# File 'lib/groonga/query-logger.rb', line 156

def log(flag, timestamp, info, message)
  guard do
    @callback.call(:log, flag, timestamp, info, message)
  end
end

#reopenObject



162
163
164
165
166
# File 'lib/groonga/query-logger.rb', line 162

def reopen
  guard do
    @callback.call(:reopen)
  end
end