refactor: improve the log

This commit is contained in:
Kevin Yue 2023-09-01 09:50:23 +08:00
parent 356946e635
commit 69502b22a9

View File

@ -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, {