From 8983a446aa086cfa865e48559046e35814d1b959 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Thu, 11 Jan 2024 17:42:46 +0000 Subject: [PATCH 1/2] fix(cli): running the cli with --debug does not print traces But that's what debug is for, printing traces with sourcemap. So let's just always enabled tracing when debugging. --- packages/aws-cdk/lib/cli.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/aws-cdk/lib/cli.ts b/packages/aws-cdk/lib/cli.ts index 5574f487a496c..b92439fdef322 100644 --- a/packages/aws-cdk/lib/cli.ts +++ b/packages/aws-cdk/lib/cli.ts @@ -315,16 +315,17 @@ if (!process.stdout.isTTY) { export async function exec(args: string[], synthesizer?: Synthesizer): Promise { const argv = await parseCommandLineArguments(args); + if (argv.verbose) { + setLogLevel(argv.verbose); + } + if (argv.debug) { enableSourceMapSupport(); } - if (argv.verbose) { - setLogLevel(argv.verbose); - - if (argv.verbose > 2) { - enableTracing(true); - } + // Debug should always imply tracing + if (argv.debug ||argv.verbose > 2) { + enableTracing(true); } if (argv.ci) { From cc3dac2ba6092cb243bdaa34d68a5fa76595868f Mon Sep 17 00:00:00 2001 From: Kaizen Conroy <36202692+kaizencc@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:45:11 -0500 Subject: [PATCH 2/2] Update packages/aws-cdk/lib/cli.ts --- packages/aws-cdk/lib/cli.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/cli.ts b/packages/aws-cdk/lib/cli.ts index b92439fdef322..0871e2a42814c 100644 --- a/packages/aws-cdk/lib/cli.ts +++ b/packages/aws-cdk/lib/cli.ts @@ -324,7 +324,7 @@ export async function exec(args: string[], synthesizer?: Synthesizer): Promise 2) { + if (argv.debug || argv.verbose > 2) { enableTracing(true); }