json_logger.go 413 B

123456789101112131415
  1. package log
  2. import (
  3. "io"
  4. "github.com/go-kit/log"
  5. )
  6. // NewJSONLogger returns a Logger that encodes keyvals to the Writer as a
  7. // single JSON object. Each log event produces no more than one call to
  8. // w.Write. The passed Writer must be safe for concurrent use by multiple
  9. // goroutines if the returned Logger will be used concurrently.
  10. func NewJSONLogger(w io.Writer) Logger {
  11. return log.NewJSONLogger(w)
  12. }