Class: Rodbot::Log::LoggerIO
- Inherits:
-
Object
- Object
- Rodbot::Log::LoggerIO
- Defined in:
- lib/rodbot/log.rb
Overview
Simple wrapper to decorate a logger for use with $stdout and $stderr
Instance Method Summary collapse
-
#initialize(logger, level) ⇒ LoggerIO
constructor
@ param logger [Logger] logger instance @ param level [Integer] any log level from
Logger
. -
#method_missing ⇒ Object
Swallow any other method such as
sync
orflush
. -
#write(message) ⇒ Object
Write to the log.
Constructor Details
#initialize(logger, level) ⇒ LoggerIO
@ param logger [Logger] logger instance @ param level [Integer] any log level from Logger
50 51 52 |
# File 'lib/rodbot/log.rb', line 50 def initialize(logger, level) @logger, @level = logger, level end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
Swallow any other method such as sync
or flush
62 63 |
# File 'lib/rodbot/log.rb', line 62 def method_missing(*) end |
Instance Method Details
#write(message) ⇒ Object
Write to the log
57 58 59 |
# File 'lib/rodbot/log.rb', line 57 def write() @logger.log(@level, .strip) end |