configsupport

package
v0.0.0-...-3a9ac50 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextZerologAdapter

func ContextZerologAdapter() logging.Logger

ContextZerologAdapter returns a logging.Logger that implements logging.ContextLogger.

Use this if you are attaching a zerolog.Logger to every context passed into the AWS clients. The logger will be retrieved with zerolog.Ctx.

Usage

cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithLogger(configsupport.ContextZerologAdapter()))

See https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/logging/.

func Default

func Default(o *config.LoadOptions) error

Default adds a context-aware zerolog logger (ContextZerologAdapter) as well as turn on client logging only if IsDebug is true.

Use this if you want a sensible setup for your AWS client.

Usage

cfg, err := config.LoadDefaultConfig(context.TODO(), configsupport.Default))

func IsDebug

func IsDebug() bool

IsDebug returns true when DEBUG environment variable is "1" or "true".

func StaticZerologAdapter

func StaticZerologAdapter(logger *zerolog.Logger) logging.Logger

StaticZerologAdapter wraps a zerolog.Logger and returns a logging.Logger that does not implement logging.ContextLogger.

Use this if you aren't attaching a zerolog.Logger to every context passed into the AWS clients. Because zerolog.Ctx never returns nil (it may return a disabled logger), having a separate variant vs. one that is context-aware (ContextZerologAdapter) can be useful.

Usage

cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithLogger(configsupport.NewContextlessZeroLogAdapter()))

See https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/logging/.

Types

This section is empty.

Jump to

Keyboard shortcuts

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