code: func NewSessionWithConfigLevel(awsConfig *aws.Config,
  	level aws.LogLevelType,
  	logger *logrus.Logger) *session.Session {
  	if nil == awsConfig {
  		awsConfig = &aws.Config{
  			CredentialsChainVerboseErrors: aws.Bool(true),
  		}
  	}
  
  	// Log AWS calls if needed
  	switch logger.Level {
  	case logrus.DebugLevel:
  		awsConfig.LogLevel = aws.LogLevel(level)
  	}
  	awsConfig.Logger = &logrusProxy{logger}
  	sess, sessErr := session.NewSession(awsConfig)
  	if sessErr != nil {
  		logger.WithField("Error", sessErr).Warn("Failed to create AWS Session")
  	} else {
  		sess.Handlers.Send.PushFront(func(r *request.Request) {
  			logger.WithFields(logrus.Fields{
  				"Service":   r.ClientInfo.ServiceName,
  				"Operation": r.Operation.Name,
  				"Method":    r.Operation.HTTPMethod,
  				"Path":      r.Operation.HTTPPath,
  				"Payload":   r.Params,
  			}).Debug("AWS Request")
  		})
  	}
  
  	logger.WithFields(logrus.Fields{
  		"Name":    aws.SDKName,
  		"Version": aws.SDKVersion,
  	}).Debug("AWS SDK Info")
  	return sess
  }
docs: // NewSessionWithConfigLevel returns an AWS Session (https://github.com/aws/aws-sdk-go/wiki/Getting-Started-Configuration)
  // object that attaches a debug level handler to all AWS requests from services
  // sharing the session value.