...

Package log

import "oss.terrastruct.com/d2/lib/log"
Overview
Index

Overview ▾

Package log is a context wrapper around slog.Logger

func AppendSinks

func AppendSinks(ctx context.Context, s ...slog.Sink) context.Context

func Critical

func Critical(ctx context.Context, msg string, fields ...slog.Field)

func Debug

func Debug(ctx context.Context, msg string, fields ...slog.Field)

func Error

func Error(ctx context.Context, msg string, fields ...slog.Field)

func Fatal

func Fatal(ctx context.Context, msg string, fields ...slog.Field)

func Fork

func Fork(ctx, loggerCtx context.Context) context.Context

func Info

func Info(ctx context.Context, msg string, fields ...slog.Field)

func Init

func Init()

func Leveled

func Leveled(ctx context.Context, level slog.Level) context.Context

func Named

func Named(ctx context.Context, name string) context.Context

func Stderr

func Stderr(ctx context.Context) context.Context

func Stdlib

func Stdlib(ctx context.Context, level slog.Level) *log.Logger

func Sync

func Sync(ctx context.Context)

func Warn

func Warn(ctx context.Context, msg string, fields ...slog.Field)

func With

func With(ctx context.Context, l slog.Logger) context.Context

func WithTB

func WithTB(ctx context.Context, t testing.TB, opts *slogtest.Options) context.Context

WithTB calls With with the result of slogtest.Make.