logsentry

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

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

Go to latest
Published: Nov 26, 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 (*Writer) BeginMessage

func (w *Writer) BeginMessage(config golog.Config, t time.Time, level golog.Level, prefix, text string)

func (*Writer) CommitMessage

func (w *Writer) CommitMessage()

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)

type WriterConfig

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

func NewWriterConfig

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

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

func (*WriterConfig) FlushUnderlying

func (c *WriterConfig) FlushUnderlying()

func (*WriterConfig) WriterForNewMessage

func (c *WriterConfig) WriterForNewMessage(ctx context.Context, level golog.Level) golog.Writer

Jump to

Keyboard shortcuts

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