Class: TestServer::UiLogger
- Inherits:
-
Object
- Object
- TestServer::UiLogger
- Defined in:
- lib/test_server/ui_logger.rb
Instance Method Summary collapse
-
#initialize ⇒ UiLogger
constructor
A new instance of UiLogger.
- #level=(l) ⇒ Object
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ UiLogger
Returns a new instance of UiLogger.
10 11 12 |
# File 'lib/test_server/ui_logger.rb', line 10 def initialize @logger = ::Logger.new($stderr) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
33 34 35 |
# File 'lib/test_server/ui_logger.rb', line 33 def method_missing(method, *args, &block) logger.public_send method, *args end |
Instance Method Details
#level=(l) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/test_server/ui_logger.rb', line 14 def level=(l) logger.level = case l.to_s.to_sym when :unknown ::Logger::UNKNOWN when :fatal ::Logger::FATAL when :error ::Logger::ERROR when :warn ::Logger::WARN when :info ::Logger::INFO when :debug ::Logger::DEBUG else ::Logger::ERROR end end |