Codebase list golang-github-go-kit-kit / dff50435-7a33-4f0c-bbdc-f455eb10d80a/upstream/0.12.0+git20220826.1.a7ba4fa log / json_logger.go
dff50435-7a33-4f0c-bbdc-f455eb10d80a/upstream/0.12.0+git20220826.1.a7ba4fa

Tree @dff50435-7a33-4f0c-bbdc-f455eb10d80a/upstream/0.12.0+git20220826.1.a7ba4fa (Download .tar.gz)

json_logger.go @dff50435-7a33-4f0c-bbdc-f455eb10d80a/upstream/0.12.0+git20220826.1.a7ba4faraw · 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)
}