From 2a914add8391f345ee1096b9deb729c05d3e06c3 Mon Sep 17 00:00:00 2001 From: Alex Schofield Date: Tue, 20 Aug 2024 15:15:02 +0100 Subject: feat: add more logging for debugging --- src/extract_lambda.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/extract_lambda.py b/src/extract_lambda.py index e9f438b..24f0981 100644 --- a/src/extract_lambda.py +++ b/src/extract_lambda.py @@ -10,13 +10,16 @@ from botocore.exceptions import ClientError from pg8000.native import Connection, InterfaceError, identifier logger = logging.getLogger(__name__) + logging.basicConfig( format="{asctime} - {levelname} - {message}", style="{", datefmt="%Y-%m-%d %H:%M", - level=logging.INFO, + level=logging.DEBUG, ) +logging.getLogger("botocore").setLevel(logging.WARNING) + class DBConnectionException(Exception): """Wraps pg8000.native Error or DatabaseError.""" @@ -110,7 +113,7 @@ def list_existing_s3_files(bucket_name=extract_bucket(), client=boto3.client("s3 results of listing the contents of the s3 bucket, then returns the populated dictionary """ - + logging.info("Listing existing S3 files") existing_files = {} try: -- cgit v1.2.3