Color corrections.

master
Karchnu 2020-11-04 19:23:58 +01:00
parent 69a3326fea
commit 2ced54cccc
1 changed files with 16 additions and 7 deletions

View File

@ -101,12 +101,15 @@ class Baguette::Log
# FIXME: def log(), that puts stuff as-is in the logs. # FIXME: def log(), that puts stuff as-is in the logs.
def self.debug(text) def self.debug(text)
return unless Baguette::Context.verbosity > 2 return unless Baguette::Context.verbosity > 3
STDERR.puts ":: #{text}".colorize(:cyan) STDERR
.<<(":: ".colorize(:cyan))
.<<(text.colorize(:cyan))
.<<("\n")
STDERR.flush STDERR.flush
end end
def self.info(text) def self.info(text)
return unless Baguette::Context.verbosity > 1 return unless Baguette::Context.verbosity > 2
STDOUT STDOUT
.<<(":: ".colorize(:blue)) .<<(":: ".colorize(:blue))
.<<(text.colorize(:white)) .<<(text.colorize(:white))
@ -114,7 +117,7 @@ class Baguette::Log
STDOUT.flush STDOUT.flush
end end
def self.title(text) def self.title(text)
return unless Baguette::Context.verbosity > 1 return unless Baguette::Context.verbosity > 2
STDOUT STDOUT
.<<("|> ".colorize(:blue).bright) .<<("|> ".colorize(:blue).bright)
.<<(text.colorize(:white).bright) .<<(text.colorize(:white).bright)
@ -122,13 +125,19 @@ class Baguette::Log
STDOUT.flush STDOUT.flush
end end
def self.warning(text) def self.warning(text)
return unless Baguette::Context.verbosity > 0 return unless Baguette::Context.verbosity > 1
STDERR.puts ":: #{text}".colorize(:yellow) STDERR
.<<(":: ".colorize(:yellow).bright)
.<<(text.colorize(:yellow))
.<<("\n")
STDERR.flush STDERR.flush
end end
def self.error(text) def self.error(text)
return unless Baguette::Context.verbosity > 0 return unless Baguette::Context.verbosity > 0
STDERR.puts "!! #{text}".colorize(:red) STDERR
.<<("!! ".colorize(:red).bright)
.<<(text.colorize(:red))
.<<("\n")
STDERR.flush STDERR.flush
end end
end end