log

package
v1.0.0-beta.205 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const OTelCodeStackTrace = "code.stacktrace"

OTelCodeStackTrace a stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. See: https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/attributes-registry/code.md

Variables

This section is empty.

Functions

func PanicLogger

func PanicLogger(options ...func(*panicLoggerOptions))

PanicLogger is a function that logs panics and then propagates the failure based on the propagationStrategy setting Usage (in main):

defer log.PanicLogger(log.WithExit)

func WithContinue

func WithContinue(o *panicLoggerOptions)

WithContinue is an option to set the propagation strategy to continue the program after logging the panic

func WithExit

func WithExit(o *panicLoggerOptions)

WithExit is an option to set the propagation strategy to exit the program after logging the panic

func WithRePanic

func WithRePanic(o *panicLoggerOptions)

WithRePanic is an option to set the propagation strategy to propagate the panic after logging it

Types

type MockHandler

type MockHandler struct {
	mock.Mock
}

func NewMockHandler

func NewMockHandler() *MockHandler

func (*MockHandler) Enabled

func (m *MockHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*MockHandler) Handle

func (m *MockHandler) Handle(ctx context.Context, record slog.Record) error

func (*MockHandler) WithAttrs

func (m *MockHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*MockHandler) WithGroup

func (m *MockHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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