From 69502b22a9ce995ce2014150823588b742c2dd33 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Fri, 1 Sep 2023 09:50:23 +0800 Subject: [PATCH] refactor: improve the log --- gpgui/src/atoms/loginPortal.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gpgui/src/atoms/loginPortal.ts b/gpgui/src/atoms/loginPortal.ts index a388399..7c69f73 100644 --- a/gpgui/src/atoms/loginPortal.ts +++ b/gpgui/src/atoms/loginPortal.ts @@ -80,6 +80,12 @@ export const loginPortalAtom = atom( throw new AbnormalPortalConfigError("Empty user auth cookie"); } + logger.info( + `Retrieved ${gateways.length} gateways, userAuthCookie: ${redact( + userAuthCookie + )}, prelogonUserAuthCookie: ${redact(prelogonUserAuthCookie)}` + ); + // Here, we have got the portal config successfully, refresh the cached portal data const previousSelectedGateway = get(selectedGatewayAtom)?.name; const selectedGateway = gateways.find( @@ -106,7 +112,11 @@ export const loginPortalAtom = atom( preferredGateway: previousSelectedGateway, }); - logger.info(`Found the preferred gateway: ${name} (${redact(address)})`); + logger.info( + `Found the preferred gateway: ${name} (${redact( + address + )}) for region: ${region}` + ); // Log in to the gateway await set(loginGatewayAtom, address, {