log

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 4 Imported by: 86

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debug(msg string, keyvals ...interface{})
	Info(msg string, keyvals ...interface{})
	Warn(msg string, keyvals ...interface{})
	Error(msg string, keyvals ...interface{})
}

Logger is an interface that can be passed to ClientOptions.Logger.

func NewStructuredLogger added in v1.25.0

func NewStructuredLogger(logger *slog.Logger) Logger

NewStructuredLogger creates an adapter around the given logger to be passed to Temporal.

func Skip added in v1.25.0

func Skip(logger Logger, depth int) Logger

Skip creates a child Logger that increase increases its' caller skip depth if it implements WithSkipCallers. Otherwise returns the original logger.

func With added in v1.6.0

func With(logger Logger, keyvals ...interface{}) Logger

With creates a child Logger that includes the supplied key-value pairs in each log entry. It does this by using the supplied logger if it implements WithLogger; otherwise, it does so by intercepting every log call.

type WithLogger

type WithLogger interface {
	With(keyvals ...interface{}) Logger
}

WithLogger is an interface that prepend every log entry with keyvals.

type WithSkipCallers added in v1.25.0

type WithSkipCallers interface {
	WithCallerSkip(int) Logger
}

WithSkipCallers is an optional interface that a Logger can implement that may create a new child logger that skips the number of stack frames of the caller. This call must not mutate the original logger.

Jump to

Keyboard shortcuts

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