Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

logging

v0.0.0-20261201013705-9f9696e572b3
cloudeng.io/logging

Package name and synopsis are indexed at v0.0.0-20261201234437-eeaa7e01491e. Documentation and version details below use v0.0.0-20261201013705-9f9696e572b3.

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

5 matches

Top ↑

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.

Dependency graph