gruntwork-io / cloud-nuke

A tool for cleaning up your cloud accounts by nuking (deleting) all resources within it
https://gruntwork.io/
MIT License
2.81k stars 358 forks source link

Consistent Logging Messages Across Resources #692

Closed james03160927 closed 6 months ago

james03160927 commented 7 months ago

There's several places where we can improve logging across resources. This could be additional work on top of issue like this:

Here are some suggestions:

    if len(identifiers) == 0 {
        logging.Debugf("No API Gateways (v1) to nuke in region %s", gateway.Region)
    }
    if len(identifiers) > 100 {
        logging.Errorf("Nuking too many API Gateways (v1) at once (100): " +
            "halting to avoid hitting AWS API rate limiting")
        return TooManyApiGatewayErr{}
    }

consistent message format for users experience & readability:

    logging.Debugf("["+
            "OK] API Gateway (v1) %s deleted in %s", aws.StringValue(apigwID), gateway.Region)
    logging.Debugf(
        "[Failed] Error deleting API Gateway (v1) %s in %s", aws.StringValue(apigwID), gateway.Region)