Topic:   AWS CLI Debug logs are not captured and printed by stdout or stderr
Feb 19, 2021 12:34 0 Replies 15 Views SHALINI

Hi, so i wrote a go program that executes several aws cli commands(aws apigateway get-export and aws apigateway get-rest-apis) in the background, but in debug mode when the aws cli commands are executed with the debug flag (--debug) and when the output of the commands are printed the debug logs are not printed, only the final output(which is the get-export command was successfully executed message or the list of apis from the get-rest-apis cmd) is printed. How do I capture the debug logs of these commands and get them printed in the terminal ?

here is a sample of my code,
cmd_3, err := exec.Command(awsCmdLiteral, apiGateway, getExport, apiIdFlag, api_id, stageNameFlag, stageName, exportTypeFlag, exportType, path, outputFlag, outputType, "--debug").Output()
 

if err != nil {
return err
}
 

if utils.VerboseModeEnabled() {
output := string(cmd_3[:])
fmt.Println(output)
}

Prev Next
Topic Replies (0)
Leave a Reply
Guest User

Not sure what course is right for you?

Choose the right course for you.
Get the help of our experts and find a course that best suits your needs.


Let`s Connect