add named logger + color formatting

This commit is contained in:
Alex Goodman
2020-05-22 11:30:45 -04:00
parent 09c7ca8f8f
commit ae6feed8fc
8 changed files with 103 additions and 27 deletions
+21
View File
@@ -0,0 +1,21 @@
package format
import "fmt"
const (
DefaultColor Color = iota + 30
Red
Green
Yellow
Blue
Magenta
Cyan
White
)
type Color uint8
// TODO: not cross platform (windows...)
func (c Color) Format(s string) string {
return fmt.Sprintf("\x1b[%dm%s\x1b[0m", c, s)
}