slog

package
v0.53.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0, BSD-3-Clause, MIT, + 1 more Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LevelDebug = slog.LevelDebug
	LevelInfo  = slog.LevelInfo
	LevelWarn  = slog.LevelWarn
	LevelError = slog.LevelError
)

Variables

This section is empty.

Functions

func Default

func Default() *slog.Logger

func Int added in v0.48.3

func Int(k string, v int) slog.Attr

func New

func New(h slog.Handler) *slog.Logger

func NewRecord

func NewRecord(t time.Time, lvl slog.Level, s string, p uintptr) slog.Record

func SetDefault added in v0.43.0

func SetDefault(lgr *slog.Logger)

func String

func String(k, v string) slog.Attr

func StringValue

func StringValue(value string) slog.Value

Types

type Attr

type Attr = slog.Attr

type Handler

type Handler = slog.Handler

func NewJSONHandler

func NewJSONHandler(w io.Writer, opts *HandlerOptions) Handler

func NewTextHandler

func NewTextHandler(w io.Writer, opts *HandlerOptions) Handler

type HandlerOptions

type HandlerOptions = slog.HandlerOptions

type Level

type Level = slog.Level

type LevelVar

type LevelVar = slog.LevelVar

type Leveler

type Leveler = slog.Leveler

type Logger

type Logger = slog.Logger

type Record

type Record = slog.Record

type Value

type Value = slog.Value

Jump to

Keyboard shortcuts

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