Class: Groonga::CallbackLogger

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

Instance Method Summary collapse

Constructor Details

#initialize(callback) ⇒ CallbackLogger

Returns a new instance of CallbackLogger.



119
120
121
122
# File 'lib/groonga/logger.rb', line 119

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

Instance Method Details

#finObject



136
137
138
139
140
# File 'lib/groonga/logger.rb', line 136

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

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



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

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

#reopenObject



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

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