1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 20:20:49 +00:00

colorlog for [INFO]

This commit is contained in:
ZhengYang 2014-08-14 12:20:49 +08:00
parent 104b35e062
commit 923a02f99b

View File

@ -58,6 +58,7 @@ const (
//NRed = uint8(31) // Normal
EndColor = "\033[0m"
INFO = "INFO"
TRAC = "TRAC"
ERRO = "ERRO"
WARN = "WARN"
@ -139,6 +140,8 @@ func ColorLogS(format string, a ...interface{}) string {
func getColorLevel(level string) string {
level = strings.ToUpper(level)
switch level {
case INFO:
return fmt.Sprintf("\033[%dm%s\033[0m", Blue, level)
case TRAC:
return fmt.Sprintf("\033[%dm%s\033[0m", Blue, level)
case ERRO: