Class: GlassOctopus::Middleware::CommonLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/glass_octopus/middleware/common_logger.rb

Constant Summary collapse

FORMAT =
"Processed message. topic=%s, partition=%d, key=%s, runtime=%fms".freeze

Instance Method Summary collapse

Constructor Details

#initialize(app, logger = nil, log_level = :info) ⇒ CommonLogger

Returns a new instance of CommonLogger


8
9
10
11
12
# File 'lib/glass_octopus/middleware/common_logger.rb', line 8

def initialize(app, logger=nil, log_level=:info)
  @app = app
  @logger = logger
  @log_level = log_level
end

Instance Method Details

#call(ctx) ⇒ Object


14
15
16
# File 'lib/glass_octopus/middleware/common_logger.rb', line 14

def call(ctx)
  log(ctx) { @app.call(ctx) }
end