Class: Fog::Logger
- Inherits:
-
Object
- Object
- Fog::Logger
- Defined in:
- lib/fog/core/logger.rb
Class Method Summary collapse
- .[](channel) ⇒ Object
- .[]=(channel, value) ⇒ Object
- .debug(message) ⇒ Object
- .deprecation(message) ⇒ Object
- .warning(message) ⇒ Object
- .write(key, value) ⇒ Object
Class Method Details
.[](channel) ⇒ Object
10 11 12 |
# File 'lib/fog/core/logger.rb', line 10 def self.[](channel) @channels[channel] end |
.[]=(channel, value) ⇒ Object
14 15 16 |
# File 'lib/fog/core/logger.rb', line 14 def self.[]=(channel, value) @channels[channel] = value end |
.debug(message) ⇒ Object
18 19 20 |
# File 'lib/fog/core/logger.rb', line 18 def self.debug() write(:debug, "[light_black][fog][DEBUG] #{}[/]\n") end |
.deprecation(message) ⇒ Object
22 23 24 |
# File 'lib/fog/core/logger.rb', line 22 def self.deprecation() write(:deprecation, "[yellow][fog][DEPRECATION] #{}[/]\n") end |
.warning(message) ⇒ Object
26 27 28 |
# File 'lib/fog/core/logger.rb', line 26 def self.warning() write(:warning, "[yellow][fog][WARNING] #{}[/]\n") end |
.write(key, value) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fog/core/logger.rb', line 30 def self.write(key, value) channel = @channels[key] if channel = if channel.tty? value.gsub(Fog::Formatador::PARSE_REGEX) { "\e[#{Fog::Formatador::STYLES[$1.to_sym]}m" }.gsub(Fog::Formatador::INDENT_REGEX, "") else value.gsub(Fog::Formatador::PARSE_REGEX, "").gsub(Fog::Formatador::INDENT_REGEX, "") end channel.write() end nil end |