From 98db8b6b9de4c37e0df774b2ad14c0bbb43bfe5f Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Thu, 30 Nov 2017 08:35:54 -0800 Subject: [PATCH] Move monitor output to logger interface. --- monitors.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/monitors.go b/monitors.go index 16ed7b2..75afff9 100644 --- a/monitors.go +++ b/monitors.go @@ -16,7 +16,6 @@ package realis import ( - "fmt" "time" "github.com/paypal/gorealis/gen-go/apache/aurora" @@ -59,7 +58,7 @@ func (m *Monitor) JobUpdate(updateKey aurora.JobUpdateKey, interval int, timeout updateDetail := response.JobUpdateDetails(respDetail) if len(updateDetail) == 0 { - fmt.Println("No update found") + m.Client.RealisConfig().logger.Println("No update found") return false, errors.New("No update found for " + updateKey.String()) } status := updateDetail[0].Update.Summary.State.Status @@ -70,13 +69,13 @@ func (m *Monitor) JobUpdate(updateKey aurora.JobUpdateKey, interval int, timeout // if we encounter an inactive state and it is not at rolled forward, update failed switch status { case aurora.JobUpdateStatus_ROLLED_FORWARD: - fmt.Println("Update succeded") + m.Client.RealisConfig().logger.Println("Update succeded") return true, nil case aurora.JobUpdateStatus_FAILED: - fmt.Println("Update failed") + m.Client.RealisConfig().logger.Println("Update failed") return false, errors.New(UpdateFailed) case aurora.JobUpdateStatus_ROLLED_BACK: - fmt.Println("rolled back") + m.Client.RealisConfig().logger.Println("rolled back") return false, errors.New(RolledBack) default: return false, nil