format

package
v0.0.0-...-27647ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Overview

Copyright 2022 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2022 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2022 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Copyright 2022 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJsonFormatter

func NewJsonFormatter(opts FormatterOpts) slog.Formatter

func NewTextFormatter

func NewTextFormatter(opts FormatterOpts) slog.Formatter

func WriteTimeRFC3339Millis

func WriteTimeRFC3339Millis(buf *buffer.Buffer, t time.Time)

This takes half the time of Time.AppendFormat.

Types

type FormatterOpts

type FormatterOpts struct {
	OmitTime  bool
	OmitLevel bool
	AddSource bool

	ReplaceAttr func(groups []string, a slog.Attr) slog.Attr
}

type Style

type Style interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL