From c5345239fc974b266b267441210b2e5e1afc8c24 Mon Sep 17 00:00:00 2001 From: John Guo Date: Fri, 20 Aug 2021 15:49:45 +0800 Subject: [PATCH] improve logging content for package gcron --- os/gcron/gcron_entry.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/os/gcron/gcron_entry.go b/os/gcron/gcron_entry.go index 300c74fd4..81ed8a778 100644 --- a/os/gcron/gcron_entry.go +++ b/os/gcron/gcron_entry.go @@ -128,10 +128,7 @@ func (entry *Entry) check() { return case StatusClosed: - entry.logDebugf( - "[gcron] %s(%s) %s removed", - entry.Name, entry.schedule.pattern, entry.jobName, - ) + entry.logDebugf("[gcron] %s %s removed", entry.schedule.pattern, entry.jobName) entry.Close() case StatusReady: @@ -139,15 +136,9 @@ func (entry *Entry) check() { case StatusRunning: defer func() { if err := recover(); err != nil { - entry.logErrorf( - "[gcron] %s(%s) %s end with error: %+v", - entry.Name, entry.schedule.pattern, entry.jobName, err, - ) + entry.logErrorf("[gcron] %s %s end with error: %+v", entry.schedule.pattern, entry.jobName, err) } else { - entry.logDebugf( - "[gcron] %s(%s) %s end", - entry.Name, entry.schedule.pattern, entry.jobName, - ) + entry.logDebugf("[gcron] %s %s end", entry.schedule.pattern, entry.jobName) } if entry.timerEntry.Status() == StatusClosed { @@ -164,10 +155,7 @@ func (entry *Entry) check() { } } } - entry.logDebugf( - "[gcron] %s(%s) %s start", - entry.Name, entry.schedule.pattern, entry.jobName, - ) + entry.logDebugf("[gcron] %s %s start", entry.schedule.pattern, entry.jobName) entry.Job() }