simplelog/console_handler.go

17 lines
301 B
Go
Raw Normal View History

2024-05-14 04:43:47 +00:00
package simplelog
import (
"github.com/fatih/color"
)
type ConsoleHandler struct{}
func NewConsoleHandler() *ConsoleHandler {
return &ConsoleHandler{}
}
func (c *ConsoleHandler) Log(event Event) error {
color.New(color.FgBlue).PrintfFunc()("%s: %s\n", event.Level, event.Message)
return nil
}