Class: Yell::Adapters::Io
- Includes:
- Helpers::Formatter
- Defined in:
- lib/yell/adapters/io.rb
Constant Summary collapse
- TTYColors =
The possible unix log colors
{ 0 => "\033[1;32m", # green 1 => "\033[0m", # normal 2 => "\033[1;33m", # yellow 3 => "\033[1;31m", # red 4 => "\033[1;35m", # magenta 5 => "\033[1;36m", # cyan -1 => "\033[0m" # normal }
Instance Attribute Summary collapse
-
#colors ⇒ Object
Sets colored output on or off (default off).
-
#sync ⇒ Object
Sets the “sync mode” to true or false.
Instance Method Summary collapse
-
#colorize! ⇒ Object
Shortcut to enable colors.
Methods included from Helpers::Formatter
Methods inherited from Base
close, #close, #initialize, #inspect, open, setup, write, #write
Methods included from Helpers::Level
Constructor Details
This class inherits a constructor from Yell::Adapters::Base
Instance Attribute Details
#colors ⇒ Object
Sets colored output on or off (default off)
33 34 35 |
# File 'lib/yell/adapters/io.rb', line 33 def colors @colors end |
#sync ⇒ Object
Sets the “sync mode” to true or false.
When true (default), every log event is immediately written to the file. When false, the log event is buffered internally.
24 25 26 |
# File 'lib/yell/adapters/io.rb', line 24 def sync @sync end |
Instance Method Details
#colorize! ⇒ Object
Shortcut to enable colors.
39 |
# File 'lib/yell/adapters/io.rb', line 39 def colorize!; @colors = true; end |