Files
AynaLivePlayer/pkg/logger/color.go
Aynakeya 5cc5948a85 Merge 1.0.x branch (#8)
* rewrite

* update submodule

* make width height configurable

* update dependency

* update

* update file

* update dep

* fix basic config layout

* update plugin management

* more stuff

* add blacklist

* fix todo

* fix windows gethandle

* update windows update guide

* update windows build guide

* include go mod tidy in script

* update todo

* fix source session

* fix text output

* add plugin play duration control

* fix id diange not working

* update todo

* update version number
2024-04-22 21:21:02 -07:00

30 lines
533 B
Go

package logger
import "fmt"
const (
LogColorBlack Color = iota + 30
LogColorRed
LogColorGreen
LogColorYellow
LogColorBlue
LogColorMagenta
LogColorCyan
LogColorWhite
)
// Color represents a text color.
type Color uint8
// Add adds the coloring to the given string.
func (c Color) Add(s string) string {
return fmt.Sprintf("\x1b[%dm%s\x1b[0m", uint8(c), s)
}
var LogColorMap = map[LogLevel]Color{
LogLevelError: LogColorRed,
LogLevelWarn: LogColorYellow,
LogLevelInfo: LogColorCyan,
LogLevelDebug: LogColorWhite,
}