mirror of
https://github.com/beego/bee.git
synced 2024-11-22 20:20:55 +00:00
colorlog for [INFO]
This commit is contained in:
parent
104b35e062
commit
923a02f99b
3
util.go
3
util.go
@ -58,6 +58,7 @@ const (
|
|||||||
//NRed = uint8(31) // Normal
|
//NRed = uint8(31) // Normal
|
||||||
EndColor = "\033[0m"
|
EndColor = "\033[0m"
|
||||||
|
|
||||||
|
INFO = "INFO"
|
||||||
TRAC = "TRAC"
|
TRAC = "TRAC"
|
||||||
ERRO = "ERRO"
|
ERRO = "ERRO"
|
||||||
WARN = "WARN"
|
WARN = "WARN"
|
||||||
@ -139,6 +140,8 @@ func ColorLogS(format string, a ...interface{}) string {
|
|||||||
func getColorLevel(level string) string {
|
func getColorLevel(level string) string {
|
||||||
level = strings.ToUpper(level)
|
level = strings.ToUpper(level)
|
||||||
switch level {
|
switch level {
|
||||||
|
case INFO:
|
||||||
|
return fmt.Sprintf("\033[%dm%s\033[0m", Blue, level)
|
||||||
case TRAC:
|
case TRAC:
|
||||||
return fmt.Sprintf("\033[%dm%s\033[0m", Blue, level)
|
return fmt.Sprintf("\033[%dm%s\033[0m", Blue, level)
|
||||||
case ERRO:
|
case ERRO:
|
||||||
|
Loading…
Reference in New Issue
Block a user