From 016cb4bc8233eac3c6d07ac4b591a3fe060edacd Mon Sep 17 00:00:00 2001 From: Peter Kraft Date: Thu, 12 Oct 2023 16:05:51 -0700 Subject: [PATCH] use logger --- hello-world-extended/src/operations.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hello-world-extended/src/operations.ts b/hello-world-extended/src/operations.ts index 6f5f4c00..ad100160 100644 --- a/hello-world-extended/src/operations.ts +++ b/hello-world-extended/src/operations.ts @@ -17,7 +17,7 @@ export class Hello { await ctxt.invoke(Hello).greetPostman(greeting); return greeting; } catch (e) { - console.warn("Error sending request:", e); + ctxt.logger.error(e); await ctxt.invoke(Hello).rollbackHelloTransaction(user); return `Greeting failed for ${user}\n` } @@ -46,13 +46,13 @@ export class Hello { } @OperonCommunicator() - static async greetPostman(_ctxt: CommunicatorContext, greeting: string) { + static async greetPostman(ctxt: CommunicatorContext, greeting: string) { await axios.get("https://postman-echo.com/get", { params: { greeting: greeting } }); - console.log(`Greeting sent to postman!`); + ctxt.logger.info(`Greeting sent to postman!`); } @PostApi('/clear/:user')