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.



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

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

Instance Method Details

#finObject



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

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

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



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

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

#reopenObject



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

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