Class: Faye::Redis::Logger
- Inherits:
-
Object
- Object
- Faye::Redis::Logger
- Defined in:
- lib/faye/redis/logger.rb
Constant Summary collapse
- LEVELS =
{ silent: 0, error: 1, info: 2, debug: 3 }.freeze
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(component, options = {}) ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
11 12 13 |
# File 'lib/faye/redis/logger.rb', line 11 def component @component end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
11 12 13 |
# File 'lib/faye/redis/logger.rb', line 11 def level @level end |
Instance Method Details
#debug(message) ⇒ Object
27 28 29 |
# File 'lib/faye/redis/logger.rb', line 27 def debug() log(:debug, ) if @level >= LEVELS[:debug] end |
#error(message) ⇒ Object
19 20 21 |
# File 'lib/faye/redis/logger.rb', line 19 def error() log(:error, ) if @level >= LEVELS[:error] end |
#info(message) ⇒ Object
23 24 25 |
# File 'lib/faye/redis/logger.rb', line 23 def info() log(:info, ) if @level >= LEVELS[:info] end |