lib/ougai/child_logger.rb in ougai-1.2.0 vs lib/ougai/child_logger.rb in ougai-1.3.0

- old
+ new

@@ -9,16 +9,18 @@ def level @parent.level end - def chain(severity, args, fields) - @parent.chain(severity, args, merge_fields(@with_fields, fields)) + def chain(severity, args, fields, hooks) + hooks.push(@before_log) if @before_log + @parent.chain(severity, args, merge_fields(@with_fields, fields), hooks) end protected def append(severity, args) - @parent.chain(severity, args, @with_fields) + hooks = @before_log ? [@before_log] : [] + @parent.chain(severity, args, @with_fields, hooks) end end end