servicelogger

package
v1.104.6 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Dev = "dev"

Variables

This section is empty.

Functions

func EmptyLogger

func EmptyLogger() *log.Helper

func InitZapLogger

func InitZapLogger(env string) (log.Logger, error)

func LogAndMaskErr

func LogAndMaskErr(in error, logger *log.Helper) error

LogAndMaskErr records an error but masks it with a generic one to avoid leaking sensitive information

func ScopedHelper

func ScopedHelper(logger log.Logger, scope string) *log.Helper

ScopedHelper returns a new helper with information about the current component

func SentryBeforeSend added in v1.104.6

func SentryBeforeSend(event *sentry.Event, hint *sentry.EventHint) *sentry.Event

SentryBeforeSend enriches Sentry error events so issues are distinguishable at a glance and group deterministically by failure mode:

  • A structured discriminator extends Sentry's default fingerprint
  • A generic wrapper type on the primary exception is rewritten to the root-cause type
  • Tags expose the root-cause metadata for search

Events without an original error to analyze (messages, transactions) and errors without a structured discriminator are left untouched, preserving Sentry's default grouping. Joined multi-errors (errors.Join) also keep default grouping: bundling independent failures makes any single fingerprint misleading, though their metadata is tagged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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