Add context to log statements.
This commit is contained in:
@ -153,7 +153,7 @@ func (w *AWSFunctionWorkload) executeCommand(ctx context.Context, command []stri
|
||||
Cmd: command,
|
||||
Files: w.fs,
|
||||
}
|
||||
log.WithField("request", data).Trace("Sending request to AWS")
|
||||
log.WithContext(ctx).WithField("request", data).Trace("Sending request to AWS")
|
||||
rawData, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
exit <- ExitInfo{uint8(1), fmt.Errorf("cannot stingify aws function request: %w", err)}
|
||||
@ -202,7 +202,7 @@ func (w *AWSFunctionWorkload) receiveOutput(
|
||||
|
||||
switch wsMessage.Type {
|
||||
default:
|
||||
log.WithField("data", wsMessage).Warn("unexpected message from aws function")
|
||||
log.WithContext(ctx).WithField("data", wsMessage).Warn("unexpected message from aws function")
|
||||
case dto.WebSocketExit:
|
||||
return wsMessage.ExitCode, nil
|
||||
case dto.WebSocketOutputStdout:
|
||||
|
Reference in New Issue
Block a user