goamz
goamz copied to clipboard
Support Logging
We need more visibility down into the request layer to tackle bugs like mitchellh/packer#668. We can do this by logging. Logging unconditionally on the root logger sucks, so I recommend we expose a log.Logger to the EC2 struct that everyone will use.
By default, we can make this a Logger instance that goes to ioutil.Discard.
For API, I recommend adding a new function NewWithLogger:
func NewWithLogger(auth aws.Auth, region aws.Region, logger *log.Logger) *EC2 {
}
We can't support something like a SetLogger because modifying the logger is a race if any requests are happening.
ccing myself here.
understanding our aws api usage is getting more and more important. I think the api limit for ec2 is around 100/minute. I think this api makes a lot of sense, and should let us do something like add a graphite handler.
@mwhooker Yeah it actually lets us add a lot. For example: https://github.com/hashicorp/logutils/blob/master/level.go I want to bring this into Packer at some point. So if we follow that structure it'll just work