logging
v0.0.0-20261202063711-0b09e264f8c4
cloudeng.io/logging
Documentation
pkg.go.dev ↗Types
JSONFormatter
type JSONFormatter struct {
// contains filtered or unexported fields
}
JSONFormatter implements a log formatter that outputs JSON formatted logs.
NewJSONFormatter
func NewJSONFormatter(w io.Writer, prefix, indent string) *JSONFormatter
NewJSONFormatter creates a new JSONFormatter that writes to with the specified prefix and indent.
JSONFormatter.Format
func (js *JSONFormatter) Format(v any) error
Format formats the specified value as JSON.
JSONFormatter.Write
func (js *JSONFormatter) Write(p []byte) (n int, err error)
Write implements the io.Writer interface and it assumes that it is called with a complete JSON object.