Module: Rack::Timeout::Logger
Instance Attribute Summary collapse
-
#device ⇒ Object
Returns the value of attribute device.
-
#level ⇒ Object
Returns the value of attribute level.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
Instance Attribute Details
#device ⇒ Object
Returns the value of attribute device.
7 8 9 |
# File 'lib/rack/timeout/logger.rb', line 7 def device @device end |
#level ⇒ Object
Returns the value of attribute level.
7 8 9 |
# File 'lib/rack/timeout/logger.rb', line 7 def level @level end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/rack/timeout/logger.rb', line 7 def logger @logger end |
Instance Method Details
#disable ⇒ Object
27 28 29 30 |
# File 'lib/rack/timeout/logger.rb', line 27 def disable @observer, @logger, @level, @device, @inited = nil ::Rack::Timeout.unregister_state_change_observer(:logger) end |
#init ⇒ Object
21 22 23 24 25 |
# File 'lib/rack/timeout/logger.rb', line 21 def init @observer = ::Rack::Timeout::StateChangeLoggingObserver.new ::Rack::Timeout.register_state_change_observer(:logger, &@observer.callback) @inited = true end |
#update(new_device, new_level) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/rack/timeout/logger.rb', line 32 def update(new_device, new_level) init unless @inited @device = new_device || $stderr @level = new_level || ::Logger::INFO self.logger = ::Rack::Timeout::StateChangeLoggingObserver.mk_logger(device, level) end |