log

package
v0.0.0-...-ff909ee Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 14 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, args ...any)

Debug is Debug

func Debugf

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

Debugf is Debugf

func Error

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

Error forwards to sentry

func Errorf

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

Errorf forwards to sentry

func Fatalf

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

Fatalf forwards to sentry

func GetGlobalLogger

func GetGlobalLogger() *zerolog.Logger

GetGlobalLogger returns global logger

func Info

func Info(ctx context.Context, args ...any)

Info is Info

func Infof

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

Infof is Infof

func SentryDefer

func SentryDefer()

SentryDefer .

func SetupLog

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

SetupLog init logger

func Warn

func Warn(ctx context.Context, args ...any)

Warn is Warn

func Warnf

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

Warnf is Warnf

Types

type Fields

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

Fields is a wrapper for zerolog.Entry we need to insert some sentry captures here

func WithField

func WithField(key string, value any) *Fields

WithField add kv into log entry

func WithFunc

func WithFunc(fname string) *Fields

WithFunc is short for WithField

func (Fields) Debug

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

Debug is Debug

func (Fields) Debugf

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

Debugf is Debugf

func (Fields) Error

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

Error forwards to sentry

func (Fields) Errorf

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

Errorf forwards to sentry

func (Fields) Fatalf

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

Fatalf forwards to sentry

func (Fields) Info

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

Info is Info

func (Fields) Infof

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

Infof is Infof

func (Fields) Warn

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

Warn is Warn

func (Fields) Warnf

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

Warnf is Warnf

func (*Fields) WithField

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

WithField .

Jump to

Keyboard shortcuts

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