Skip to content

Commit

Permalink
added print error for failure messages in cloudformation
Browse files Browse the repository at this point in the history
  • Loading branch information
daidokoro committed Jul 20, 2017
1 parent d3472f2 commit fb3d0a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stacks/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ func (s *Stack) tail(c string, done <-chan bool) {
event := stackevents.StackEvents[0]

statusReason := ""
var lg = Log.Info
if strings.Contains(*event.ResourceStatus, "FAILED") {
statusReason = *event.ResourceStatusReason
lg = Log.Error
}

line := strings.Join([]string{
Expand All @@ -55,7 +57,7 @@ func (s *Stack) tail(c string, done <-chan bool) {
if _, ok := printed[line]; !ok {
evt := strings.Split(*event.ResourceStatus, "_")[0]
if evt == c || c == "" || strings.Contains(strings.ToLower(evt), "rollback") {
Log.Info(strings.Trim(line, "- "))
lg(strings.Trim(line, "- "))
}

printed[line] = nil
Expand Down

0 comments on commit fb3d0a0

Please sign in to comment.