Codebase list golang-github-go-kit-kit / run/f9d8373b-9935-4125-b2b2-694ccabcf82b/main log / json_logger.go
run/f9d8373b-9935-4125-b2b2-694ccabcf82b/main

Tree @run/f9d8373b-9935-4125-b2b2-694ccabcf82b/main (Download .tar.gz)

json_logger.go @run/f9d8373b-9935-4125-b2b2-694ccabcf82b/main

8650f26
 
 
2a88002
8650f26
801da84
 
8650f26
f307245
d235bef
 
 
2a88002
801da84
de65931
package log

import (
	"io"

	"github.com/go-kit/log"
)

// NewJSONLogger returns a Logger that encodes keyvals to the Writer as a
// single JSON object. Each log event produces no more than one call to
// w.Write. The passed Writer must be safe for concurrent use by multiple
// goroutines if the returned Logger will be used concurrently.
func NewJSONLogger(w io.Writer) Logger {
	return log.NewJSONLogger(w)
}