Class: MockEM::LoggerWithPrefix
- Inherits:
-
Object
- Object
- MockEM::LoggerWithPrefix
- Defined in:
- lib/mock_em/logger_with_prefix.rb
Overview
Logs all messages with the specified prefix. Warning: this is a not a full-fledged Logger implementation, it just logs string messages.
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#raw_logger ⇒ Object
readonly
Returns the value of attribute raw_logger.
Instance Method Summary collapse
- #debug(msg) ⇒ Object
- #error(msg) ⇒ Object
- #info(msg) ⇒ Object
-
#initialize(prefix, logger) ⇒ LoggerWithPrefix
constructor
A new instance of LoggerWithPrefix.
- #warn(msg) ⇒ Object
Constructor Details
#initialize(prefix, logger) ⇒ LoggerWithPrefix
Returns a new instance of LoggerWithPrefix.
10 11 12 13 |
# File 'lib/mock_em/logger_with_prefix.rb', line 10 def initialize(prefix, logger) @prefix = prefix @raw_logger = logger end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
7 8 9 |
# File 'lib/mock_em/logger_with_prefix.rb', line 7 def prefix @prefix end |
#raw_logger ⇒ Object (readonly)
Returns the value of attribute raw_logger.
8 9 10 |
# File 'lib/mock_em/logger_with_prefix.rb', line 8 def raw_logger @raw_logger end |
Instance Method Details
#debug(msg) ⇒ Object
15 |
# File 'lib/mock_em/logger_with_prefix.rb', line 15 def debug(msg); log_with_prefix(:debug, msg) end |
#error(msg) ⇒ Object
18 |
# File 'lib/mock_em/logger_with_prefix.rb', line 18 def error(msg); log_with_prefix(:error, msg) end |
#info(msg) ⇒ Object
16 |
# File 'lib/mock_em/logger_with_prefix.rb', line 16 def info(msg); log_with_prefix(:info, msg) end |
#warn(msg) ⇒ Object
17 |
# File 'lib/mock_em/logger_with_prefix.rb', line 17 def warn(msg); log_with_prefix(:warn, msg) end |