Class: Groonga::CallbackLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/groonga/logger.rb,
ext/groonga/rb-grn-logger.c

Instance Method Summary collapse

Methods inherited from Logger

flags, flags=, log, log_path, log_path=, max_level, max_level=, path, path=, query_log_path, query_log_path=, register, reopen, rotate_threshold_size, rotate_threshold_size=, unregister

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