Initial commit
This commit is contained in:
33
log/taint.go
Normal file
33
log/taint.go
Normal file
@ -0,0 +1,33 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"novit.nc/direktil/src/pkg/color"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user