log

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 13 Imported by: 42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatalf

func Fatalf(ctx context.Context, err error, format string, args ...any)

Fatalf logs at fatal level and reports to Sentry.

func GetGlobalLogger

func GetGlobalLogger() *zerolog.Logger

func SentryDefer

func SentryDefer()

SentryDefer reports a panic to Sentry and re-raises it.

func SentryFlush added in v0.1.4

func SentryFlush()

SentryFlush sends the events still queued; main defers it so a normal exit loses none.

func SetupLog

func SetupLog(ctx context.Context, cfg *types.ServerLogConfig, dsn string) error

SetupLog configures the global logger and the optional Sentry client.

Types

type Fields

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

Fields carries key-value context for one log entry.

func WithField

func WithField(key string, value any) *Fields

WithField returns a Fields tagged with key and value.

func WithFunc

func WithFunc(fname string) *Fields

WithFunc tags the entry with the enclosing function name.

func (*Fields) Debug

func (f *Fields) Debug(ctx context.Context, args ...any)

func (*Fields) Debugf

func (f *Fields) Debugf(ctx context.Context, format string, args ...any)

func (*Fields) Error

func (f *Fields) Error(ctx context.Context, err error, args ...any)

Error logs at error level and reports to Sentry.

func (*Fields) Errorf

func (f *Fields) Errorf(ctx context.Context, err error, format string, args ...any)

Errorf logs at error level and reports to Sentry.

func (*Fields) Fatalf

func (f *Fields) Fatalf(ctx context.Context, err error, format string, args ...any)

Fatalf logs at fatal level and reports to Sentry.

func (*Fields) Info

func (f *Fields) Info(ctx context.Context, args ...any)

func (*Fields) Infof

func (f *Fields) Infof(ctx context.Context, format string, args ...any)

func (*Fields) Warn

func (f *Fields) Warn(ctx context.Context, args ...any)

func (*Fields) Warnf

func (f *Fields) Warnf(ctx context.Context, format string, args ...any)

func (*Fields) WithField

func (f *Fields) WithField(key string, value any) *Fields

WithField returns a copy of f tagged with key and value; f itself is left untouched.

Jump to

Keyboard shortcuts

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