log

package
v0.0.0-...-266fb8d Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 4 Imported by: 0

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

func NewStructuredLogger(logger *slog.Logger) Logger

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

func Skip

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

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

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