Class: DynamoAutoscale::StandardFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamo-autoscale/standard_formatter.rb

Instance Method Summary collapse

Constructor Details

#initializeStandardFormatter

Returns a new instance of StandardFormatter.



3
4
5
# File 'lib/dynamo-autoscale/standard_formatter.rb', line 3

def initialize
  @formatter = ::Logger::Formatter.new
end

Instance Method Details

#call(severity, time, progname, msg) ⇒ Object



7
8
9
10
11
12
# File 'lib/dynamo-autoscale/standard_formatter.rb', line 7

def call(severity, time, progname, msg)
  table = DynamoAutoscale.current_table
  msg   = "[#{table.name}] #{msg}" if table

  @formatter.call(severity, time, progname, msg)
end