diff options
author | Robin Jarry <robin@jarry.cc> | 2023-06-04 21:53:10 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-06-12 11:23:09 +0200 |
commit | 19fda33bf211e7ed556364419e3be957312cd4ae (patch) | |
tree | aefaa92c4623481ead92e7ba8d85f7b9fc1e2393 /worker/maildir/search.go | |
parent | 13e356c4a4a296edea4245fb8850aeba49ae1851 (diff) | |
download | aerc-19fda33bf211e7ed556364419e3be957312cd4ae.tar.gz |
maildir: use named logger
Use the worker's logging functions to have all maildir 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/maildir/search.go')
-rw-r--r-- | worker/maildir/search.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/worker/maildir/search.go b/worker/maildir/search.go index 49cb1c6e..911e6a3d 100644 --- a/worker/maildir/search.go +++ b/worker/maildir/search.go @@ -109,7 +109,7 @@ func getParsedFlag(name string) maildir.Flag { func (w *Worker) search(criteria *searchCriteria) ([]uint32, error) { requiredParts := getRequiredParts(criteria) - log.Debugf("Required parts bitmask for search: %b", requiredParts) + w.worker.Debugf("Required parts bitmask for search: %b", requiredParts) keys, err := w.c.UIDs(*w.selected) if err != nil { @@ -131,7 +131,7 @@ func (w *Worker) search(criteria *searchCriteria) ([]uint32, error) { success, err := w.searchKey(key, criteria, requiredParts) if err != nil { // don't return early so that we can still get some results - log.Errorf("Failed to search key %d: %v", key, err) + w.worker.Errorf("Failed to search key %d: %v", key, err) } else if success { mu.Lock() matchedUids = append(matchedUids, key) @@ -246,7 +246,7 @@ func (w *Worker) searchKey(key uint32, criteria *searchCriteria, } if parts&DATE > 0 { if date, err := header.RFC822Headers.Date(); err != nil { - log.Errorf("Failed to get date from header: %v", err) + w.worker.Errorf("Failed to get date from header: %v", err) } else { if !criteria.startDate.IsZero() { if date.Before(criteria.startDate) { |