class Sw::LogFormatter::ContextualFormatter
Attributes
context[RW]
Public Class Methods
new(context: {}, tags: [])
click to toggle source
Calls superclass method
# File lib/sw/log_formatter/contextual_formatter.rb, line 8 def initialize(context: {}, tags: []) super() self.context = context self.tags = tags end
Public Instance Methods
with_context(context) { |self| ... }
click to toggle source
# File lib/sw/log_formatter/contextual_formatter.rb, line 14 def with_context(context) previous_context = self.context self.context = context yield self ensure self.context = previous_context end