Class: Logger::LogDevice
- Inherits:
-
Object
- Object
- Logger::LogDevice
- Defined in:
- lib/log.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#devs ⇒ Object
readonly
Returns the value of attribute devs.
Instance Method Summary collapse
Instance Attribute Details
#devs ⇒ Object (readonly)
Returns the value of attribute devs.
18 19 20 |
# File 'lib/log.rb', line 18 def devs @devs end |
Instance Method Details
#attach(log) ⇒ Object
20 21 22 23 |
# File 'lib/log.rb', line 20 def attach(log) @devs ||= {} @devs[log] = open_logfile(log) end |
#detach(log) ⇒ Object
25 26 27 28 29 |
# File 'lib/log.rb', line 25 def detach(log) @devs ||= {} @devs[log].close @devs.delete(log) end |
#old_write ⇒ Object
31 |
# File 'lib/log.rb', line 31 alias_method :old_write, :write |
#write(message) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/log.rb', line 33 def write() old_write() @devs ||= {} @devs.each do |log, dev| dev.write() end end |