Added option to enable AWS CRT debug logging

This commit is contained in:
Pascal Bourque
2025-11-23 10:29:41 -05:00
parent f7c3dc07b3
commit 6c24d59760
3 changed files with 18 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ const rootLogger = pino({
/** Main entry point of the example application. */
async function main() {
let session: MysaSession | undefined;
try {
rootLogger.info('Loading session...');
const sessionJson = await readFile('session.json', 'utf8');
@@ -27,7 +28,11 @@ async function main() {
} catch {
rootLogger.info('No valid session file found.');
}
const client = new MysaApiClient(session, { logger: rootLogger.child({ module: 'mysa-js-sdk' }) });
const client = new MysaApiClient(session, {
logger: rootLogger.child({ module: 'mysa-js-sdk' }),
isAwsCrtDebugLoggingEnabled: process.env.AWS_CRT_DEBUG_LOGGING === '1'
});
client.emitter.on('sessionChanged', async (newSession) => {
if (newSession) {