sentryutil

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Unlicense Imports: 8 Imported by: 0

Documentation

Overview

Package sentryutil contains utilities for functions for working with Sentry.

Index

Constants

View Source
const DSNEnv = "SENTRY_DSN"

DSNEnv is the name of the environment variable for the Sentry DSN.

View Source
const DefaultLoggerPrefix = "sentry_default_hub"

DefaultLoggerPrefix is the default prefix for the debug logger set in SetDefaultLogger.

Variables

This section is empty.

Functions

func InitDefaultHub

func InitDefaultHub(release string) (err error)

InitDefaultHub initializes the default Sentry hub. It returns an error if DSNEnv isn't set in the environment.

func MustInitDefaultHub

func MustInitDefaultHub(release string)

MustInitDefaultHub is like InitDefaultHub but panics on errors. This function should be used in a main function.

func ReportPanics

func ReportPanics()

ReportPanics reports all panics using the default Sentry hub and repanics. This function should be used in a main function, after the default Sentry hub has been configured. It should be called in a defer.

func SetDefaultLogger

func SetDefaultLogger(l *slog.Logger, p string)

SetDefaultLogger sets the default Sentry logger to l with prefix p and level debug. If p is empty, DefaultLoggerPrefix is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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