simplelog/json_handler.go

19 lines
273 B
Go
Raw Normal View History

2024-05-14 04:43:47 +00:00
package simplelog
import (
"encoding/json"
"log"
)
type JSONHandler struct{}
func NewJSONHandler() *JSONHandler {
return &JSONHandler{}
}
func (j *JSONHandler) Log(event Event) error {
jsonData, _ := json.Marshal(event)
log.Println(string(jsonData))
return nil
}