logsentry

package module
v0.0.0-...-e718d2e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UnknownLevel will be used if a golog.Level
	// can't be mapped to a sentry.LevelError.
	UnknownLevel = sentry.LevelError

	FlushTimeout time.Duration = 3 * time.Second
)

Functions

func ContextWithoutLogging

func ContextWithoutLogging(parent context.Context) context.Context

ContextWithoutLogging returns a new context with Sentry logging disabled for all levels.

func IsContextWithoutLogging

func IsContextWithoutLogging(ctx context.Context) bool

IsContextWithoutLogging returns true if the passed context was returned from ContextWithoutLogging, which means Sentry logging disabled for all levels.

Types

type Writer

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

func NewWriter

func NewWriter(hub *sentry.Hub, format *golog.Format, filter golog.LevelFilter, valsAsMsg bool, extra map[string]any) *Writer

NewWriter returns a new Writer for a sentry.Hub. Any values passed as extra will be added to every log messsage.

func (*Writer) BeginMessage

func (w *Writer) BeginMessage(ctx context.Context, logger *golog.Logger, t time.Time, level golog.Level, text string) golog.Writer

func (*Writer) CommitMessage

func (w *Writer) CommitMessage()

func (*Writer) FlushUnderlying

func (w *Writer) FlushUnderlying()

func (*Writer) String

func (w *Writer) String() string

func (*Writer) WriteBool

func (w *Writer) WriteBool(val bool)

func (*Writer) WriteError

func (w *Writer) WriteError(val error)

func (*Writer) WriteFloat

func (w *Writer) WriteFloat(val float64)

func (*Writer) WriteInt

func (w *Writer) WriteInt(val int64)

func (*Writer) WriteJSON

func (w *Writer) WriteJSON(val []byte)

func (*Writer) WriteKey

func (w *Writer) WriteKey(key string)

func (*Writer) WriteNil

func (w *Writer) WriteNil()

func (*Writer) WriteSliceEnd

func (w *Writer) WriteSliceEnd()

func (*Writer) WriteSliceKey

func (w *Writer) WriteSliceKey(key string)

func (*Writer) WriteString

func (w *Writer) WriteString(val string)

func (*Writer) WriteUUID

func (w *Writer) WriteUUID(val [16]byte)

func (*Writer) WriteUint

func (w *Writer) WriteUint(val uint64)

Jump to

Keyboard shortcuts

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