Class: Flor::Logger::Out
- Inherits:
-
Object
- Object
- Flor::Logger::Out
- Defined in:
- lib/flor/unit/logger.rb
Instance Attribute Summary collapse
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Class Method Summary collapse
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(unit) ⇒ Out
constructor
A new instance of Out.
- #log_colours? ⇒ Boolean
- #puts(s) ⇒ Object
Constructor Details
#initialize(unit) ⇒ Out
Returns a new instance of Out.
262 |
# File 'lib/flor/unit/logger.rb', line 262 def initialize(unit); @unit = unit; end |
Instance Attribute Details
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
260 261 262 |
# File 'lib/flor/unit/logger.rb', line 260 def unit @unit end |
Class Method Details
.prepare(unit) ⇒ Object
268 269 270 271 272 273 274 275 276 277 |
# File 'lib/flor/unit/logger.rb', line 268 def self.prepare(unit) case o = unit.conf.fetch('log_out', 1) when false, 'null' then NoOut.new(unit) when 1, true, 'stdout' then StdOut.new(unit, $stdout) when 2, 'stderr' then StdOut.new(unit, $stderr) when /::/ then Flor.const_lookup(o).new(unit) else FileOut.new(unit, o) end end |
Instance Method Details
#close ⇒ Object
266 |
# File 'lib/flor/unit/logger.rb', line 266 def close; end |
#flush ⇒ Object
265 |
# File 'lib/flor/unit/logger.rb', line 265 def flush; end |
#log_colours? ⇒ Boolean
263 |
# File 'lib/flor/unit/logger.rb', line 263 def log_colours?; @unit.conf.fetch('log_colours') { :no } == true; end |
#puts(s) ⇒ Object
264 |
# File 'lib/flor/unit/logger.rb', line 264 def puts(s); end |