Skip to content

Commit 60215b6

Browse files
authored
Log validate and summary errors to the output channel (#1492)
## Changes Log validate and summary errors to the output channel. Currently we print generic error line, but no specifics ## Tests <!-- How is this tested? -->
1 parent 887771e commit 60215b6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

packages/databricks-vscode/src/cli/CliWrapper.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,9 @@ export class CliWrapper {
497497
configfilePath?: string,
498498
logger?: logging.NamedLogger
499499
) {
500+
const bundleOpName = "validate";
500501
return await runBundleCommand(
501-
"validate",
502+
bundleOpName,
502503
this.cliPath,
503504
["bundle", "validate", "--target", target],
504505
workspaceFolder,
@@ -509,10 +510,9 @@ export class CliWrapper {
509510
},
510511
await this.getBundleCommandEnvVars(authProvider, configfilePath),
511512
logger,
512-
{
513-
onStdOut: (data) => logger?.debug(data, {target}),
514-
onStdError: (data) => logger?.debug(data, {target}),
515-
}
513+
// Print stdout to the debug log (not visible in the output channel).
514+
// stderr data will be printed to the output channel with the error level.
515+
{onStdOut: (data) => logger?.debug(data, {target, bundleOpName})}
516516
);
517517
}
518518

@@ -523,8 +523,9 @@ export class CliWrapper {
523523
configfilePath?: string,
524524
logger?: logging.NamedLogger
525525
) {
526+
const bundleOpName = "summarize";
526527
return await runBundleCommand(
527-
"summarize",
528+
bundleOpName,
528529
this.cliPath,
529530
[
530531
"bundle",
@@ -544,10 +545,9 @@ export class CliWrapper {
544545
},
545546
await this.getBundleCommandEnvVars(authProvider, configfilePath),
546547
logger,
547-
{
548-
onStdOut: (data) => logger?.debug(data, {target}),
549-
onStdError: (data) => logger?.debug(data, {target}),
550-
}
548+
// Print stdout to the debug log (not visible in the output channel).
549+
// stderr data will be printed to the output channel with the error level.
550+
{onStdOut: (data) => logger?.debug(data, {target, bundleOpName})}
551551
);
552552
}
553553

0 commit comments

Comments
 (0)