lib/ougai/logger.rb in ougai-0.7.2 vs lib/ougai/logger.rb in ougai-0.7.3

- old
+ new

@@ -30,9 +30,22 @@ def fatal(message, ex = nil, data = nil) super(to_item(message, ex, data)) end + def self.broadcast(logger) + Module.new do |mdl| + ::Logger::Severity.constants.each do |severity| + method_name = severity.downcase.to_sym + + mdl.send(:define_method, method_name) do |*args| + logger.send(method_name, *args) + super(*args) + end + end + end + end + protected def create_formatter Formatters::Bunyan.new end