Class: Groonga::CallbackLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/groonga/logger.rb

Instance Method Summary collapse

Methods inherited from Logger

log_path, log_path=, query_log_path, query_log_path=

Constructor Details

#initialize(callback) ⇒ CallbackLogger

Returns a new instance of CallbackLogger.



145
146
147
148
# File 'lib/groonga/logger.rb', line 145

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

Instance Method Details

#finObject



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

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

#log(level, timestamp, title, message, location) ⇒ Object



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

def log(level, timestamp, title, message, location)
  guard do
    @callback.call(:log, level, timestamp, title, message, location)
  end
end

#reopenObject



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

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