Class: ClickHouse::Middleware::Logging
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- ClickHouse::Middleware::Logging
- Defined in:
- lib/click_house/middleware/logging.rb
Constant Summary collapse
- SUMMARY_HEADER =
'x-clickhouse-summary'
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#starting ⇒ Object
readonly
Returns the value of attribute starting.
Instance Method Summary collapse
- #call(environment) ⇒ Object
-
#initialize(app = nil, logger:) ⇒ Logging
constructor
A new instance of Logging.
Constructor Details
#initialize(app = nil, logger:) ⇒ Logging
Returns a new instance of Logging.
12 13 14 15 |
# File 'lib/click_house/middleware/logging.rb', line 12 def initialize(app = nil, logger:) @logger = logger super(app) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
10 11 12 |
# File 'lib/click_house/middleware/logging.rb', line 10 def body @body end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
10 11 12 |
# File 'lib/click_house/middleware/logging.rb', line 10 def logger @logger end |
#starting ⇒ Object (readonly)
Returns the value of attribute starting.
10 11 12 |
# File 'lib/click_house/middleware/logging.rb', line 10 def starting @starting end |
Instance Method Details
#call(environment) ⇒ Object
17 18 19 20 21 |
# File 'lib/click_house/middleware/logging.rb', line 17 def call(environment) @starting = @body = environment.body if log_body? @app.call(environment).on_complete(&method(:on_complete)) end |