Sha256: ab73bb49990fbff8e0a151457f31687dc8a5b6c9326b4998944fd90d51187eac
Contents?: true
Size: 1.02 KB
Versions: 16
Compression:
Stored size: 1.02 KB
Contents
package waiter import ( "context" "fmt" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" ) // Logger is the Logger middleware used by the waiter to log an attempt type Logger struct { // Attempt is the current attempt to be logged Attempt int64 } // ID representing the Logger middleware func (*Logger) ID() string { return "WaiterLogger" } // HandleInitialize performs handling of request in initialize stack step func (m *Logger) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { logger := middleware.GetLogger(ctx) logger.Logf(logging.Debug, fmt.Sprintf("attempting waiter request, attempt count: %d", m.Attempt)) return next.HandleInitialize(ctx, in) } // AddLogger is a helper util to add waiter logger after `SetLogger` middleware in func (m Logger) AddLogger(stack *middleware.Stack) error { return stack.Initialize.Insert(&m, "SetLogger", middleware.After) }
Version data entries
16 entries across 16 versions & 1 rubygems