Module: Faye::Logging
- Included in:
- Client, Engine::Base, Extensible, RackAdapter, Server, Transport
- Defined in:
- lib/faye/mixins/logging.rb
Constant Summary collapse
- DEFAULT_LOG_LEVEL =
:error
- LOG_LEVELS =
{ :error => 3, :warn => 2, :info => 1, :debug => 0 }
Class Attribute Summary collapse
Instance Attribute Summary collapse
Instance Method Summary collapse
Class Attribute Details
.log_level ⇒ Object
23 24 25 |
# File 'lib/faye/mixins/logging.rb', line 23 def log_level @log_level || DEFAULT_LOG_LEVEL end |
Instance Attribute Details
Instance Method Details
#log(message_args, level) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/faye/mixins/logging.rb', line 34 def log(, level) return unless Faye.logger return if LOG_LEVELS[log_level] > LOG_LEVELS[level] = .shift.gsub(/\?/) do Faye.to_json(.shift) end = Time.now.strftime('%Y-%m-%d %H:%M:%S') = " [#{ level.to_s.upcase }] [#{ self.class.name }] " puts( + + ) end |