Skip to content

Commit

Permalink
More advanced logging for cmakeUtil
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 11, 2024
1 parent d9bf660 commit 1bdc73c
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/utils/cmakeUtil.mts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ export async function configureCmakeNinja(folder: Uri): Promise<boolean> {
}

if (p1 !== p2) {
console.warn(
Logger.warn(
LoggerSource.cmake,
`Build directory has been moved from ${p1} to ${p2}` +
` - Deleting CMakeCache.txt and regenerating.`
);
Expand Down Expand Up @@ -207,17 +208,23 @@ export async function configureCmakeNinja(folder: Uri): Promise<boolean> {
},
(error, stdout, stderr) => {
if (error) {
console.error(error);
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
Logger.error(LoggerSource.cmake, error);
Logger.warn(
LoggerSource.cmake,
`Stdout of failed cmake: ${stdout}`
);
Logger.warn(
LoggerSource.cmake,
`Stderr of failed cmake: ${stderr}`
);
}

return;
}
);

child.on("error", err => {
console.error(err);
Logger.error(LoggerSource.cmake, err);
});

//child.stdout?.on("data", data => {});
Expand All @@ -226,7 +233,10 @@ export async function configureCmakeNinja(folder: Uri): Promise<boolean> {
});
child.on("exit", code => {
if (code !== 0) {
console.error(`CMake exited with code ${code ?? "unknown"}`);
Logger.error(
LoggerSource.cmake,
`CMake exited with code ${code ?? "N/A"}`
);
}
progress.report({ increment: 100 });
});
Expand Down

0 comments on commit 1bdc73c

Please sign in to comment.