aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/fetch.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-06-04 21:52:51 +0200
committerRobin Jarry <robin@jarry.cc>2023-06-12 11:23:08 +0200
commit13e356c4a4a296edea4245fb8850aeba49ae1851 (patch)
tree4bef7eef06ea554b82c16cace41eb9b9c5109459 /worker/imap/fetch.go
parent68e1809b3c602f2119505df78eea3d1d93854f83 (diff)
downloadaerc-13e356c4a4a296edea4245fb8850aeba49ae1851.tar.gz
imap: use named logger
Use the worker's logging functions to have all imap related messages prefixed by the account name. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Inwit <inwit@sindominio.net>
Diffstat (limited to 'worker/imap/fetch.go')
-rw-r--r--worker/imap/fetch.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go
index 8189e6aa..74108135 100644
--- a/worker/imap/fetch.go
+++ b/worker/imap/fetch.go
@@ -28,7 +28,7 @@ func (imapw *IMAPWorker) handleFetchMessageHeaders(
nil)
return
}
- log.Tracef("Fetching message headers: %v", toFetch)
+ imapw.worker.Tracef("Fetching message headers: %v", toFetch)
hdrBodyPart := imap.BodyPartName{
Specifier: imap.HeaderSpecifier,
}
@@ -92,7 +92,7 @@ func (imapw *IMAPWorker) handleFetchMessageHeaders(
func (imapw *IMAPWorker) handleFetchMessageBodyPart(
msg *types.FetchMessageBodyPart,
) {
- log.Tracef("Fetching message %d part: %v", msg.Uid, msg.Part)
+ imapw.worker.Tracef("Fetching message %d part: %v", msg.Uid, msg.Part)
var partHeaderSection imap.BodySectionName
partHeaderSection.Peek = true
@@ -138,7 +138,7 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart(
part, err := message.New(message.Header{Header: h},
_msg.GetBody(&partBodySection))
if message.IsUnknownCharset(err) {
- log.Warnf("unknown charset encountered "+
+ imapw.worker.Warnf("unknown charset encountered "+
"for uid %d", _msg.Uid)
} else if err != nil {
return fmt.Errorf("failed to create message reader: %w", err)
@@ -166,7 +166,7 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart(
func (imapw *IMAPWorker) handleFetchFullMessages(
msg *types.FetchFullMessages,
) {
- log.Tracef("Fetching full messages: %v", msg.Uids)
+ imapw.worker.Tracef("Fetching full messages: %v", msg.Uids)
section := &imap.BodySectionName{
Peek: true,
}