Skip to content

Commit

Permalink
log diagnostics with --debug flag (#8719)
Browse files Browse the repository at this point in the history
Co-authored-by: Catalina Peralta <[email protected]>
  • Loading branch information
catalinaperalta and cperaltah authored Aug 1, 2024
1 parent e3c82e1 commit 812273d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/tsp-client/src/typespec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 812273d

Please sign in to comment.