Class: SiteHub::Middleware::Logging::LogWrapper
- Inherits:
-
Object
- Object
- SiteHub::Middleware::Logging::LogWrapper
- Includes:
- Equality
- Defined in:
- lib/sitehub/middleware/logging/log_wrapper.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(logger) ⇒ LogWrapper
constructor
A new instance of LogWrapper.
- #write(msg) ⇒ Object
Methods included from Equality
Constructor Details
#initialize(logger) ⇒ LogWrapper
Returns a new instance of LogWrapper.
10 11 12 |
# File 'lib/sitehub/middleware/logging/log_wrapper.rb', line 10 def initialize(logger) @logger = logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/sitehub/middleware/logging/log_wrapper.rb', line 8 def logger @logger end |
Instance Method Details
#write(msg) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/sitehub/middleware/logging/log_wrapper.rb', line 14 def write(msg) if logger.respond_to?(:<<) logger << msg elsif logger.respond_to?(:write) logger.write(msg) end end |