|
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
|
|
}
|