lib/twiglet/logger.rb in twiglet-3.9.2 vs lib/twiglet/logger.rb in twiglet-3.10.0
- old
+ new
@@ -80,12 +80,18 @@
**@args.merge(default_properties: default_properties)
)
end
def context_provider(&blk)
+ new_context_provider = blk
+ if @args[:context_provider]
+ new_context_provider = lambda do
+ @args[:context_provider].call.merge(blk.call)
+ end
+ end
self.class.new(
@service_name,
- **@args.merge(context_provider: blk)
+ **@args.merge(context_provider: new_context_provider)
)
end
alias_method :warning, :warn
alias_method :critical, :fatal