49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/trooper/logger.rb', line 49
def call(severity, datetime, progname, message)
case severity
when "DEBUG"
colour("#{progname} => [#{severity}] #{message}\n", :yellow)
when "WARN"
colour("#{progname} => [#{severity}] #{message}\n", :yellow)
when "ACTION"
colour("#{progname} => [#{severity}] #{message}\n", :magenta)
when "SUCCESS"
colour("#{progname} => [#{severity}] #{message}\n", :green)
when "STRATEGY"
colour("#{progname} => [#{severity}] #{message}\n", :cyan)
when "ERROR", "FATAL"
colour("#{progname} => [#{severity}] #{message}\n", :red)
else
"#{progname} => [#{severity}] #{message}\n"
end
end
|