Class: Wildcloud::Logger::Middleware::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/wildcloud/logger/middleware/json.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Json

Returns a new instance of Json.



20
21
22
# File 'lib/wildcloud/logger/middleware/json.rb', line 20

def initialize(app)
  @app = app
end

Instance Method Details

#call(msg) ⇒ Object



24
25
26
27
# File 'lib/wildcloud/logger/middleware/json.rb', line 24

def call(msg)
  msg[:json_encoded] = ::JSON.dump(msg)
  @app.call(msg)
end