From 812273d87735b30e08b6f6443d5dc12f20d7eccc Mon Sep 17 00:00:00 2001 From: catalinaperalta Date: Thu, 1 Aug 2024 16:58:22 -0700 Subject: [PATCH] log diagnostics with --debug flag (#8719) Co-authored-by: Catalina Peralta --- 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");