From 4a74bb5c7074374771c3c9d2b5a139ee32caa195 Mon Sep 17 00:00:00 2001 From: Francesco Guardiani Date: Mon, 4 Nov 2024 10:18:10 +0100 Subject: [PATCH] Bring back logging for start/end invocation (#461) --- packages/restate-sdk/src/endpoint/handlers/generic.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/restate-sdk/src/endpoint/handlers/generic.ts b/packages/restate-sdk/src/endpoint/handlers/generic.ts index af42135..975638e 100644 --- a/packages/restate-sdk/src/endpoint/handlers/generic.ts +++ b/packages/restate-sdk/src/endpoint/handlers/generic.ts @@ -286,6 +286,7 @@ export class GenericHandler implements RestateHandler { ), () => !coreVm.is_processing() ); + console.info("Starting invocation."); // This promise is used to signal the end of the computation, // which can be either the user returns a value, @@ -317,6 +318,7 @@ export class GenericHandler implements RestateHandler { .then((bytes) => { coreVm.sys_write_output_success(bytes); coreVm.sys_end(); + console.info("Invocation completed successfully."); }) .catch((e) => { const error = ensureError(e); @@ -324,7 +326,7 @@ export class GenericHandler implements RestateHandler { !(error instanceof RestateError) || error.code !== SUSPENDED_ERROR_CODE ) { - console.warn("Function completed with an error.\n", error); + console.warn("Invocation completed with an error.\n", error); } if (error instanceof TerminalError) {