Class: Soda::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/soda/logger.rb

Defined Under Namespace

Classes: Formatter, JobLogger

Instance Method Summary collapse

Constructor Details

#initialize(*args, **kwargs) ⇒ Logger

Returns a new instance of Logger.



31
32
33
34
35
# File 'lib/soda/logger.rb', line 31

def initialize(*args, **kwargs)
  super

  self.formatter = Formatter.new
end

Instance Method Details

#with(*context) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/soda/logger.rb', line 37

def with(*context)
  ctx, formatter.context =
    formatter.context, (formatter.context + context)

  yield
ensure
  formatter.context = ctx
end