TylerBrock / saw

Fast, multi-purpose tool for AWS CloudWatch Logs
MIT License
1.41k stars 79 forks source link

Use -10m as the default start time. #73

Open a-h opened 2 years ago

a-h commented 2 years ago

I just spent a few minutes wondering why I wasn't seeing any log output. 😂

I was using saw get /aws/lambda/<group_name> but forgot to add --start -10m to the end of the command.

The default is time.Now() so I wasn't seeing any logs.

https://github.com/TylerBrock/saw/blob/77bbab20c752e2e82466ac781a64aa418e950680/config/configuration.go#L84-L92

AWS SAM [1] and Serverless Framework [2] both use -10m as their default for log retrieval, whereas saw uses the current time.

Seems like a straightforward change to set the empty string "" to -10m to match.

https://github.com/TylerBrock/saw/blob/77bbab20c752e2e82466ac781a64aa418e950680/cmd/get.go#L42-L51

What do you think? I've applied it in my fork, and am using it. Happy to PR.