Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultStdoutContext = ForceStdoutContext(context.Background())
)

Functions

func ConfigureLogging

func ConfigureLogging(mode string, isDebug bool) *slog.Logger

func ForceStdoutContext added in v1.5.0

func ForceStdoutContext(parent context.Context) context.Context

func LogValidationErrors added in v1.9.0

func LogValidationErrors(filename string, validationErrors []validator.ValidationError, err error, outputJSON bool)

func Logger

func Logger() *slog.Logger

func NewRawLoggerTo added in v1.4.0

func NewRawLoggerTo(w io.Writer) *slog.Logger

func RawLogger added in v1.3.0

func RawLogger() *slog.Logger

RawLogger returns a logger that just prints the message field as-is, without any extra formatting. This is useful for programs that need to output raw data.

Types

type OutputMode

type OutputMode string

OutputMode is a custom type for specifying a small number of allowed parameters in Cobra (cli-library).

const (
	OutputModeText OutputMode = "text"
	OutputModeJSON OutputMode = "json"
)

Jump to

Keyboard shortcuts

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