Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.
Python awsaws-emulatoraws-localaws-sdkdevtoolsdockerdynamodbec2emulatorlambdalocalstacklocalstack-alternativeministackmock-awsopen-sourcepythons3sqsterraform
Update log retrieval to filter by invoke time (#459)
Kristoffer Sjöberg398a850bf11a
diff --git a/ministack/services/lambda_svc.py b/ministack/services/lambda_svc.pyindex cbdd731e..2fbcfba1 100644--- a/ministack/services/lambda_svc.py+++ b/ministack/services/lambda_svc.py@@ -1896,6 +1896,7 @@ def _invoke_rie(container, event: dict, timeout: int) -> dict:if not ports:continuerie_url = f"http://127.0.0.1:{ports[0]['HostPort']}/2015-03-31/functions/function/invocations"+ invoke_time = time.time()req = urllib.request.Request(rie_url, data=json.dumps(event).encode(),headers={"Content-Type": "application/json"},@@ -1906,7 +1907,7 @@ def _invoke_rie(container, event: dict, timeout: int) -> dict:parsed = json.loads(body)except json.JSONDecodeError:parsed = body- logs = container.logs(stdout=True, stderr=True).decode("utf-8", errors="replace").strip()+ logs = container.logs(stdout=True, stderr=True, since=invoke_time).decode("utf-8", errors="replace").strip()# RIE sets 'Lambda-Runtime-Function-Error-Type' (or bare# 'X-Amz-Function-Error') when the handler raised an unhandled# exception. If it's set we surface the error flag + propagate the