Class: Gonzui::Logger
- Inherits:
-
Object
- Object
- Gonzui::Logger
- Defined in:
- lib/gonzui/logger.rb
Instance Attribute Summary collapse
-
#monitor ⇒ Object
writeonly
Sets the attribute monitor.
Instance Method Summary collapse
-
#initialize(out = nil, verbose_p = false) ⇒ Logger
constructor
A new instance of Logger.
- #log(format, *arguments) ⇒ Object
- #vlog(format, *arguments) ⇒ Object
Constructor Details
#initialize(out = nil, verbose_p = false) ⇒ Logger
Returns a new instance of Logger.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gonzui/logger.rb', line 15 def initialize(out = nil, verbose_p = false) @verbose_p = verbose_p @out = case out when String File.open(out, "a") when NilClass STDERR else out end @out.sync = true @monitor = nil end |
Instance Attribute Details
#monitor=(value) ⇒ Object (writeonly)
Sets the attribute monitor
28 29 30 |
# File 'lib/gonzui/logger.rb', line 28 def monitor=(value) @monitor = value end |
Instance Method Details
#log(format, *arguments) ⇒ Object
40 41 42 |
# File 'lib/gonzui/logger.rb', line 40 def log(format, *arguments) puts_log(format, *arguments) end |
#vlog(format, *arguments) ⇒ Object
44 45 46 |
# File 'lib/gonzui/logger.rb', line 44 def vlog(format, *arguments) puts_log(format, *arguments) if @verbose_p end |