3
0
Fork 0

Initial commit.

master
Luka Vandervelden 2019-11-08 23:56:07 +01:00
commit f7cd4c4d13
1 changed files with 34 additions and 0 deletions

34
src/weird-crystal-base.cr Normal file
View File

@ -0,0 +1,34 @@
require "colorize"
class Weird::Base
# FIXME: Use log files.
# FIXME: def log(), that puts stuff as-is in the logs.
def debug(text)
STDERR.puts ":: #{text}".colorize(:cyan)
STDERR.flush
end
def info(text)
STDOUT
.<<(":: ".colorize(:blue))
.<<(text.colorize(:white))
.<<("\n")
STDOUT.flush
end
def title(text)
STDOUT
.<<("|> ".colorize(:blue).bright)
.<<(text.colorize(:white).bright)
.<<("\n")
STDOUT.flush
end
def warning(text)
STDERR.puts ":: #{text}".colorize(:yellow)
STDERR.flush
end
def error(text)
STDERR.puts "!! #{text}".colorize(:red)
STDERR.flush
end
end