Codebase list golang-github-go-kit-kit / run/3b9658d9-4065-4804-9af8-16961c419f60/upstream log / json_logger.go
run/3b9658d9-4065-4804-9af8-16961c419f60/upstream

Tree @run/3b9658d9-4065-4804-9af8-16961c419f60/upstream (Download .tar.gz)

json_logger.go @run/3b9658d9-4065-4804-9af8-16961c419f60/upstreamraw · history · blame

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