go/src/log/slog/handler.go

type Handler

type defaultHandler

func newDefaultHandler(output func(uintptr, []byte) error) *defaultHandler {}

func (*defaultHandler) Enabled(_ context.Context, l Level) bool {}

// Collect the level, attributes and message in a string and
// write it with the default log.Logger.
// Let the log.Logger handle time and file/line.
func (h *defaultHandler) Handle(ctx context.Context, r Record) error {}

func (h *defaultHandler) WithAttrs(as []Attr) Handler {}

func (h *defaultHandler) WithGroup(name string) Handler {}

type HandlerOptions

const TimeKey

const LevelKey

const MessageKey

const SourceKey

type commonHandler

func (h *commonHandler) clone() *commonHandler {}

// enabled reports whether l is greater than or equal to the
// minimum level.
func (h *commonHandler) enabled(l Level) bool {}

func (h *commonHandler) withAttrs(as []Attr) *commonHandler {}

func (h *commonHandler) withGroup(name string) *commonHandler {}

// handle is the internal implementation of Handler.Handle
// used by TextHandler and JSONHandler.
func (h *commonHandler) handle(r Record) error {}

func (s *handleState) appendNonBuiltIns(r Record) {}

// attrSep returns the separator between attributes.
func (h *commonHandler) attrSep() string {}

type handleState

var groupPool

func (h *commonHandler) newHandleState(buf *buffer.Buffer, freeBuf bool, sep string) handleState {}

func (s *handleState) free() {}

func (s *handleState) openGroups() {}

const keyComponentSep

// openGroup starts a new group of attributes
// with the given name.
func (s *handleState) openGroup(name string) {}

// closeGroup ends the group with the given name.
func (s *handleState) closeGroup(name string) {}

// appendAttrs appends the slice of Attrs.
// It reports whether something was appended.
func (s *handleState) appendAttrs(as []Attr) bool {}

// appendAttr appends the Attr's key and value.
// It handles replacement and checking for an empty key.
// It reports whether something was appended.
func (s *handleState) appendAttr(a Attr) bool {}

func (s *handleState) appendError(err error) {}

func (s *handleState) appendKey(key string) {}

func (s *handleState) appendString(str string) {}

func (s *handleState) appendValue(v Value) {}

func (s *handleState) appendTime(t time.Time) {}

func appendRFC3339Millis(b []byte, t time.Time) []byte {}