Skip to content

Commit

Permalink
Show more lines on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Aug 17, 2020
1 parent f792393 commit f99be0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions renderers/config/interactive_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type InteractiveRendererConfig struct {
ProgressIndicatorCycleDuration time.Duration
SuccessStatus string
FailureStatus string
DescriptionLinesWhenFailed int
}

func NewDefaultRenderingConfig() *InteractiveRendererConfig {
Expand All @@ -24,6 +25,7 @@ func NewDefaultRenderingConfig() *InteractiveRendererConfig {
ProgressIndicatorCycleDuration: time.Second,
SuccessStatus: "✅",
FailureStatus: "❌",
DescriptionLinesWhenFailed: 100,
}
}

Expand Down
1 change: 1 addition & 0 deletions renderers/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (r *InteractiveRenderer) RenderScopeFinished(entry *echelon.LogScopeFinishe
}
n.CompleteWithColor(r.config.SuccessStatus, r.config.Colors.SuccessColor)
} else {
n.SetVisibleDescriptionLines(r.config.DescriptionLinesWhenFailed)
n.CompleteWithColor(r.config.FailureStatus, r.config.Colors.FailureColor)
}
}
Expand Down
2 changes: 1 addition & 1 deletion renderers/internal/node/echelone_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (node *EchelonNode) Render() []string {
tail := node.renderChildren()
node.lock.RLock()
defer node.lock.RUnlock()
if len(node.description) > node.visibleDescriptionLines {
if len(node.description) > node.visibleDescriptionLines && node.visibleDescriptionLines >= 0 {
tail = append(tail, "...")
tail = append(tail, node.description[(len(node.description)-node.visibleDescriptionLines):]...)
} else {
Expand Down

0 comments on commit f99be0d

Please sign in to comment.