added more strategies

This commit is contained in:
u80864958
2025-05-09 18:32:06 +02:00
parent 2283c0f9b8
commit 4e2b95f945
8 changed files with 135 additions and 38 deletions

View File

@ -22,23 +22,8 @@ func (l Level) String() string {
return "Error"
}
return "Undefined"
}
// Colorize colors a string for the shell matching to its level
func (l Level) Colorize(str string) string {
var color string
switch l {
case Debug:
color = "\033[32m" // green
case Info:
color = "\033[97m" // white
case Warn:
color = "\033[33m" // yellow
case Error:
color = "\033[31m" // red
}
return color + str + "\033[0m"
func (l Level) MarshalJSON() ([]byte, error) {
return []byte("\"" + l.String() + "\""), nil
}