From fb3d0a0bd787dff87fdb9449b9ad2181377e4871 Mon Sep 17 00:00:00 2001 From: daidokoro Date: Thu, 20 Jul 2017 11:13:20 +0100 Subject: [PATCH] added print error for failure messages in cloudformation --- stacks/tail.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stacks/tail.go b/stacks/tail.go index 331d1a0..ab59361 100644 --- a/stacks/tail.go +++ b/stacks/tail.go @@ -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{ @@ -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