2018-06-12 09:52:20 +00:00
|
|
|
package log
|
|
|
|
|
|
|
|
import (
|
2024-01-20 13:16:45 +00:00
|
|
|
"novit.tech/direktil/pkg/color"
|
2018-06-12 09:52:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
Normal Taint = iota
|
|
|
|
Info
|
|
|
|
Warning
|
|
|
|
Error
|
|
|
|
Fatal
|
|
|
|
OK
|
|
|
|
)
|
|
|
|
|
|
|
|
type Taint byte
|
|
|
|
|
|
|
|
func (t Taint) Color() color.Color {
|
|
|
|
switch t {
|
|
|
|
case Info:
|
|
|
|
return color.Blue
|
|
|
|
case Warning:
|
|
|
|
return color.Yellow
|
|
|
|
case Error:
|
|
|
|
return color.Red
|
|
|
|
case Fatal:
|
|
|
|
return color.Magenta
|
|
|
|
case OK:
|
|
|
|
return color.Green
|
|
|
|
default:
|
|
|
|
return color.None
|
|
|
|
}
|
|
|
|
}
|