From 7e840344d1bd61797ffb9dd4c3641a5635a3d0aa Mon Sep 17 00:00:00 2001 From: jar3b Date: Fri, 29 Mar 2019 01:39:52 +0300 Subject: [PATCH] Add logging job work time --- src/tasks/models.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks/models.go b/src/tasks/models.go index 6d4dacf..6d11bb8 100644 --- a/src/tasks/models.go +++ b/src/tasks/models.go @@ -143,10 +143,10 @@ func (t *Task) Run() { select { case err := <-execution.stop: if err == nil { - log.Infof("[%-20s][%d] SUCCESS", t.Name, execution.id) + log.Infof("[%-20s][%d] SUCCESS, took %v", t.Name, execution.id, time.Since(execution.time)) log.Debugf("[%-20s][%d] SUCCESS, output: %s", t.Name, execution.id, t.buf.String()) } else { - log.Infof("[%-20s][%d] ERROR, err: %v, output: %s", t.Name, execution.id, err, t.buf.String()) + log.Infof("[%-20s][%d] ERROR, took %v, err: %v, output: %s", t.Name, execution.id, time.Since(execution.time), err, t.buf.String()) } delete(t.execMap, execution.id) }