Skip to content

Commit

Permalink
Improve bundle logs (#1475)
Browse files Browse the repository at this point in the history
## Changes
- Don't log stderr twice in the case of errors
- Log correct bundle action in the case of errors
## Tests
<!-- How is this tested? -->
  • Loading branch information
ilia-db authored Dec 4, 2024
1 parent 7b962ff commit ba9518d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/databricks-vscode/src/cli/CliWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export async function waitForProcess(
if (code === 0) {
resolve();
} else {
reject(new ProcessError(stderr.join(""), code));
const message = onStdError ? "" : stderr.join("");
reject(new ProcessError(message, code));
}
});
p.on("error", (e) => new ProcessError(e.message, null));
Expand Down
4 changes: 3 additions & 1 deletion packages/databricks-vscode/src/logger/LoggerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export class LoggerManager {
format((info) => info.level === level && info)(),
format.timestamp(),
format.printf((info) => {
return `${info.bundleOpName}: ${info.message}`;
const name =
info.bundleOpName ?? info.error?.bundleOpName;
return `${name}: ${info.message}`;
})
),
level,
Expand Down

0 comments on commit ba9518d

Please sign in to comment.