Module: RUPNP::LogMixin
- Included in:
- CP::Base, CP::EventServer, CP::EventSubscriber, ControlPoint, SSDP::MulticastConnection
- Defined in:
- lib/rupnp/log_mixin.rb
Overview
Mixin to add log facility to others classes.
Constant Summary collapse
- LOG_LEVEL =
Log severity levels
{ :failure => 5, :error => 4, :warn => 3, :info => 2, :debug => 1 }
Instance Method Summary collapse
-
#log(level, msg = '') ⇒ Object
log a message.
Instance Method Details
#log(level, msg = '') ⇒ Object
log a message
22 23 24 25 26 |
# File 'lib/rupnp/log_mixin.rb', line 22 def log(level, msg='') if LOG_LEVEL[level] >= LOG_LEVEL[RUPNP.log_level] RUPNP.logdev.puts "[#{level}] #{msg}" end end |