From be25dcd6f3e13d6d281f5c5135f8c3f43ceccf45 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 11 Sep 2019 20:19:13 +0200 Subject: [PATCH] Converting to structured logging the file jobs/jobs.go (#12120) --- jobs/jobs.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jobs/jobs.go b/jobs/jobs.go index 8c97a450fc..d596bd044e 100644 --- a/jobs/jobs.go +++ b/jobs/jobs.go @@ -5,7 +5,6 @@ package jobs import ( "context" - "fmt" "time" "net/http" @@ -135,10 +134,10 @@ func (srv *JobServer) CancellationWatcher(ctx context.Context, jobId string, can for { select { case <-ctx.Done(): - mlog.Debug(fmt.Sprintf("CancellationWatcher for Job: %v Aborting as job has finished.", jobId)) + mlog.Debug("CancellationWatcher for Job Aborting as job has finished.", mlog.String("job_id", jobId)) return case <-time.After(CANCEL_WATCHER_POLLING_INTERVAL * time.Millisecond): - mlog.Debug(fmt.Sprintf("CancellationWatcher for Job: %v polling.", jobId)) + mlog.Debug("CancellationWatcher for Job started polling.", mlog.String("job_id", jobId)) if jobStatus, err := srv.Store.Job().Get(jobId); err == nil { if jobStatus.Status == model.JOB_STATUS_CANCEL_REQUESTED { close(cancelChan)