/usr/lib/ruby/vendor_ruby/fog/core/logger.rb is in ruby-fog-core 1.22.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | module Fog
class Logger
@channels = {
:deprecation => ::STDERR,
:warning => ::STDERR
}
@channels[:debug] = ::STDERR if ENV['DEBUG']
def self.[](channel)
@channels[channel]
end
def self.[]=(channel, value)
@channels[channel] = value
end
def self.debug(message)
self.write(:debug, "[light_black][fog][DEBUG] #{message}[/]\n")
end
def self.deprecation(message)
self.write(:deprecation, "[yellow][fog][DEPRECATION] #{message}[/]\n")
end
def self.warning(message)
self.write(:warning, "[yellow][fog][WARNING] #{message}[/]\n")
end
def self.write(key, value)
if channel = @channels[key]
message = if channel.tty?
value.gsub(Formatador::PARSE_REGEX) { "\e[#{Formatador::STYLES[$1.to_sym]}m" }.gsub(Formatador::INDENT_REGEX, '')
else
value.gsub(Formatador::PARSE_REGEX, '').gsub(Formatador::INDENT_REGEX, '')
end
channel.write(message)
end
nil
end
end
end
|