Skip to content

Commit

Permalink
Merge pull request #1908 from posit-dev/sagerb-expand-publisher-log-s…
Browse files Browse the repository at this point in the history
…ection-when-error-occurs

Publishing Log: expand section on error and add bullets to log message lines
  • Loading branch information
sagerb authored Jul 1, 2024
2 parents 85f3522 + be8c245 commit b3aa0dd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion extensions/vscode/src/views/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ import {

import { EventStream, displayEventStreamMessage } from "src/events";

import { EventStreamMessage } from "src/api";
import {
EventStreamMessage,
isPublishFailure,
isPublishSuccess,
} from "src/api";
import { Commands, Views } from "src/constants";

enum LogStageStatus {
Expand Down Expand Up @@ -349,6 +353,7 @@ export class LogsTreeStageItem extends TreeItem {
case LogStageStatus.failed:
this.label = this.stage.inactiveLabel;
this.iconPath = new ThemeIcon("error");
this.collapsibleState = TreeItemCollapsibleState.Expanded;
break;
}
}
Expand All @@ -362,8 +367,14 @@ export class LogsTreeLogItem extends TreeItem {
msg: EventStreamMessage,
state: TreeItemCollapsibleState = TreeItemCollapsibleState.None,
) {
if (msg.data.message) {
msg.data.message = msg.data.message.replaceAll("\n", " ");
}
super(displayEventStreamMessage(msg), state);
this.tooltip = JSON.stringify(msg);
if (!isPublishSuccess(msg) && !isPublishFailure(msg)) {
this.iconPath = new ThemeIcon("debug-stackframe-dot");
}

if (msg.data.dashboardUrl !== undefined) {
this.command = {
Expand Down

0 comments on commit b3aa0dd

Please sign in to comment.