observability

package
v0.0.0-...-99c2a2b Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const LevelFatal = slog.Level(12)

Variables

This section is empty.

Functions

func CaptureException

func CaptureException(err error, tags map[string]string)

func CaptureMessage

func CaptureMessage(msg string, tags map[string]string)

func InitSentry

func InitSentry(disabled bool, commit string)

func Reraise

func Reraise(err any, tags map[string]string)

Reraise captures an error and re-raises it. Used to capture unexpected panics.

Types

type NexusLogger

type NexusLogger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

func NewNexusLogger

func NewNexusLogger(logger *slog.Logger, tags Tags) *NexusLogger

func NewNoOpLogger

func NewNoOpLogger() *NexusLogger

func (*NexusLogger) CaptureError

func (nl *NexusLogger) CaptureError(msg string, err error, args ...interface{})

CaptureError logs an error and sends it to sentry.

func (*NexusLogger) CaptureFatal

func (nl *NexusLogger) CaptureFatal(msg string, err error, args ...interface{})

CaptureFatal logs an error at the fatal level and sends it to sentry.

func (*NexusLogger) CaptureFatalAndPanic

func (nl *NexusLogger) CaptureFatalAndPanic(msg string, err error, args ...interface{})

CaptureFatalAndPanic logs an error at the fatal level and sends it to sentry. It then panics.

func (*NexusLogger) CaptureInfo

func (nl *NexusLogger) CaptureInfo(msg string, args ...interface{})

CaptureInfo logs an info message and sends it to sentry.

func (*NexusLogger) CaptureWarn

func (nl *NexusLogger) CaptureWarn(msg string, args ...interface{})

CaptureWarn logs a warning and sends it to sentry.

func (*NexusLogger) Fatal

func (nl *NexusLogger) Fatal(msg string, err error, args ...interface{})

Fatal logs an error at the fatal level.

func (*NexusLogger) FatalAndPanic

func (nl *NexusLogger) FatalAndPanic(msg string, err error, args ...interface{})

FatalAndPanic logs an error at the fatal level and panics.

func (*NexusLogger) Reraise

func (nl *NexusLogger) Reraise(args ...any)

Reraise is used to capture unexpected panics with sentry and reraise them.

func (*NexusLogger) SetTags

func (nl *NexusLogger) SetTags(tags Tags)

type SentryClient

type SentryClient struct {
	Dsn    string
	Commit string
}

type Tags

type Tags map[string]string

Jump to

Keyboard shortcuts

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