+logging.getLogger().setLevel(level=os.getenv("LOG_LEVEL", logging.INFO))
def update_defs_from_s3(s3_client, bucket, prefix):
create_dir(AV_DEFINITION_PATH)
@@ -60,13 +52,13 @@ def update_defs_from_s3(s3_client, bucket, prefix):
s3_time = time_from_s3(s3_client, bucket, s3_path)
if s3_best_time is not None and s3_time < s3_best_time:
- print("Not downloading older file in series: %s" % filename)
+ logging.info("Not downloading older file in series: %s" % filename)
continue
else:
s3_best_time = s3_time
Advantages: it's configurable from within the source code what is getting logging and also from an environment variable passed into the lambda.