You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
409 B
24 lines
409 B
class Console
|
|
def self.log(str, indent=4, *args)
|
|
puts "#{str}"
|
|
|
|
indentstr = " "*indent
|
|
args.each do |s|
|
|
puts "#{indentstr}:: #{s}"
|
|
end
|
|
end
|
|
|
|
def self.debug(str, *args)
|
|
if DEBUG then
|
|
prefix = "[DEBUG] "
|
|
print prefix.bold
|
|
log(str, prefix.length, *args)
|
|
end
|
|
end
|
|
|
|
def self.error(str, *args)
|
|
prefix = "[ERROR] "
|
|
print prefix.red.bold
|
|
log(str.bold, prefix.length, *args)
|
|
end
|
|
end
|
|
|