diff options
author | Robin Jarry <robin@jarry.cc> | 2022-07-19 22:31:51 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-07-23 22:52:15 +0200 |
commit | cd1999555714fb886493d2d04b6c472be55cebef (patch) | |
tree | 1df3bcf5f687752db671d8bc9c7eab8a5c0fde71 /worker/imap/checkmail.go | |
parent | a1f779ccc9b16b22ad6cb2e0bf73c290fd0cc756 (diff) | |
download | aerc-cd1999555714fb886493d2d04b6c472be55cebef.tar.gz |
logging: use level-based logger functions
Do not pass logger objects around anymore. Shuffle some messages to make
them consistent with the new logging API. Avoid using %v when a more
specific verb exists for the argument types.
The loggers are completely disabled (i.e. Sprintf is not even called)
by default. They are only enabled when redirecting stdout to a file.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'worker/imap/checkmail.go')
-rw-r--r-- | worker/imap/checkmail.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/worker/imap/checkmail.go b/worker/imap/checkmail.go index 57af3af5..21f2e4bb 100644 --- a/worker/imap/checkmail.go +++ b/worker/imap/checkmail.go @@ -1,6 +1,7 @@ package imap import ( + "git.sr.ht/~rjarry/aerc/logging" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/types" "github.com/emersion/go-imap" @@ -13,7 +14,7 @@ func (w *IMAPWorker) handleCheckMailMessage(msg *types.CheckMail) { imap.StatusUnseen, } for _, dir := range msg.Directories { - w.worker.Logger.Printf("Getting status of directory %s", dir) + logging.Debugf("Getting status of directory %s", dir) status, err := w.client.Status(dir, items) if err != nil { w.worker.PostMessage(&types.Error{ |