From b9596c5d86cead61384de2292d1b6630225218c6 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 29 Jul 2024 15:53:44 -0700 Subject: [PATCH] log diagnostics with --debug flag --- tools/tsp-client/src/typespec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/tsp-client/src/typespec.ts b/tools/tsp-client/src/typespec.ts index 3557ff459ef..4d51a49afd6 100644 --- a/tools/tsp-client/src/typespec.ts +++ b/tools/tsp-client/src/typespec.ts @@ -100,16 +100,16 @@ export async function compileTsp({ Logger.debug(`Compiler options: ${JSON.stringify(options)}`); if (diagnostics.length > 0) { // This should not happen, but if it does, we should log it. - Logger.error("Diagnostics were reported while resolving compiler options...") - diagnostics.forEach((diagnostic) => { Logger.error(formatDiagnostic(diagnostic)); }); + Logger.error("Diagnostics were reported while resolving compiler options. Use the `--debug` flag to see the diagnostic output.") + diagnostics.forEach((diagnostic) => { Logger.debug(formatDiagnostic(diagnostic)); }); return false; } const program = await compile(NodeHost, resolvedMainFilePath, options); if (program.diagnostics.length > 0) { - Logger.error("Diagnostics were reported during compilation..."); - program.diagnostics.forEach((diagnostic) => { Logger.error(formatDiagnostic(diagnostic)); }); + Logger.error("Diagnostics were reported during compilation. Use the `--debug` flag to see the diagnostic output."); + program.diagnostics.forEach((diagnostic) => { Logger.debug(formatDiagnostic(diagnostic)); }); return false; } else { Logger.success("generation complete");