Class: Onelinejson::TestSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- Onelinejson::TestSubscriber
- Defined in:
- lib/onelinejson.rb
Instance Method Summary collapse
Instance Method Details
#logger ⇒ Object
34 35 36 |
# File 'lib/onelinejson.rb', line 34 def logger ::Lograge.logger.presence or super end |
#process_action(event) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/onelinejson.rb', line 10 def process_action(event) return if ::Lograge.ignore?(event) data = { request: {}, response: {}, debug_info: {} } payload = event.payload data[:request].merge! extract_request(payload) data[:response].merge! extract_status(payload) data[:response].merge! runtimes(event) data[:response].merge! location(event) data.merge! (event) = ::Lograge.formatter.call(data) logger.send(::Lograge.log_level, ) end |
#redirect_to(event) ⇒ Object
30 31 32 |
# File 'lib/onelinejson.rb', line 30 def redirect_to(event) Thread.current[:lograge_location] = event.payload[:location] end |