This commit is contained in:
2024-05-13 21:43:47 -07:00
commit f21c916eb3
15 changed files with 437 additions and 0 deletions

16
console_handler.go Normal file
View File

@@ -0,0 +1,16 @@
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
}