log

package
v5.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertNameAttr

func CertNameAttr(v string) slog.Attr

func Debug

func Debug(msg string, args ...slog.Attr)

Debug calls [Logger.Debug] on the default logger.

func Debugf

func Debugf(msg fmt.Stringer, args ...slog.Attr)

Debugf calls [Logger.Debug] on the default logger.

func Default

func Default() *slog.Logger

Default returns the default [Logger].

func DomainAttr

func DomainAttr(v string) slog.Attr

func DomainsAttr

func DomainsAttr(v []string) slog.Attr

func DurationAttr

func DurationAttr(key string, v time.Duration) slog.Attr

func Error

func Error(msg string, args ...slog.Attr)

Error calls [Logger.Error] on the default logger.

func ErrorAttr

func ErrorAttr(err error) slog.Attr

func Errorf

func Errorf(msg fmt.Stringer, args ...slog.Attr)

Errorf calls [Logger.Error] on the default logger.

func Fatal

func Fatal(msg string, args ...slog.Attr)

Fatal calls [Logger.Error] on the default logger and exit with code 1.

func Info

func Info(msg string, args ...slog.Attr)

Info calls [Logger.Info] on the default logger.

func Infof

func Infof(msg fmt.Stringer, args ...slog.Attr)

Infof calls [Logger.Info] on the default logger.

func SetDefault

func SetDefault(l *slog.Logger)

SetDefault makes l the default [Logger], which is used by the top-level functions Info, Debug and so on.

func Warn

func Warn(msg string, args ...slog.Attr)

Warn calls [Logger.Warn] on the default logger.

func Warnf

func Warnf(msg fmt.Stringer, args ...slog.Attr)

Warnf calls [Logger.Warn] on the default logger.

Types

type FormattableDuration

type FormattableDuration time.Duration

func (FormattableDuration) LogValue

func (f FormattableDuration) LogValue() slog.Value

func (FormattableDuration) String

func (f FormattableDuration) String() string

type LazyMessage

type LazyMessage struct {
	// contains filtered or unexported fields
}

func LazySprintf

func LazySprintf(msg string, args ...any) LazyMessage

func (LazyMessage) String

func (l LazyMessage) String() string

Jump to

Keyboard shortcuts

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