Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tsp-client] Log diagnostics with --debug flag #8719

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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