@staticmethod
def get_s3_bucket_locations(buckets, self_log=False):
    """return (bucket_name, prefix) for all s3 logging targets"""
    for b in buckets:
        if b.get('Logging'):
            if self_log:
                if b['Name'] != b['Logging']['TargetBucket']:
                    continue
            yield b['Logging']['TargetBucket'], b['Logging']['TargetPrefix']
        if not self_log and b['Name'].startswith('cf-templates-'):
            yield b['Name'], ''
