lib/ougai/logger.rb in ougai-1.4.4 vs lib/ougai/logger.rb in ougai-1.5.0
- old
+ new
@@ -40,10 +40,24 @@
super()
end
end
end
+ def level=(severity)
+ if severity.is_a?(Integer)
+ @level = severity
+ return
+ end
+
+ if severity.to_s.downcase == 'trace'
+ @level = TRACE
+ return
+ end
+
+ super
+ end
+
# @private
def chain(severity, args, fields, hooks)
hooks.push(@before_log) if @before_log
write(severity, args, merge_fields(@with_fields, fields), hooks)
end
@@ -59,9 +73,13 @@
def create_formatter
Formatters::Bunyan.new
end
private
+
+ def format_severity(severity)
+ to_label(severity)
+ end
def write(severity, args, fields, hooks)
data = merge_fields(fields, to_item(args))
hooks.each do |hook|
return false if hook.call(data) == false