diff options
author | Robin Jarry <robin@jarry.cc> | 2022-11-27 11:29:34 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-12-02 22:10:49 +0100 |
commit | 23a05d17ac1d23466ff73efa19576d43d06efe4b (patch) | |
tree | 49986587a62bdd89eb06ffa2aadf05f6d45cb3e7 /worker/notmuch/lib | |
parent | 70f46757449c8f24b818f4dfc5dcb87da7e327d6 (diff) | |
download | aerc-23a05d17ac1d23466ff73efa19576d43d06efe4b.tar.gz |
logging: rename package to log
Use the same name than the builtin "log" package. That way, we do not
risk logging in the wrong place.
Suggested-by: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'worker/notmuch/lib')
-rw-r--r-- | worker/notmuch/lib/database.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go index c3c92b7f..79bf5be3 100644 --- a/worker/notmuch/lib/database.go +++ b/worker/notmuch/lib/database.go @@ -9,7 +9,7 @@ import ( "time" "git.sr.ht/~rjarry/aerc/lib/uidstore" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/worker/types" notmuch "github.com/zenhack/go.notmuch" ) @@ -69,11 +69,11 @@ func (db *DB) withConnection(writable bool, cb func(*notmuch.DB) error) error { too_old := time.Now().After(db.lastOpenTime.Add(MAX_DB_AGE)) if db.db == nil || writable || too_old { if cerr := db.close(); cerr != nil { - logging.Errorf("failed to close the notmuch db: %v", cerr) + log.Errorf("failed to close the notmuch db: %v", cerr) } err := db.connect(writable) if err != nil { - logging.Errorf("failed to open the notmuch db: %v", err) + log.Errorf("failed to open the notmuch db: %v", err) return err } } @@ -81,7 +81,7 @@ func (db *DB) withConnection(writable bool, cb func(*notmuch.DB) error) error { if writable { // we need to close to commit the changes, else we block others if cerr := db.close(); cerr != nil { - logging.Errorf("failed to close the notmuch db: %v", cerr) + log.Errorf("failed to close the notmuch db: %v", cerr) } } return err @@ -307,12 +307,12 @@ func (db *DB) msgModify(key string, err = cb(msg) if err != nil { - logging.Warnf("callback failed: %v", err) + log.Warnf("callback failed: %v", err) } err = msg.TagsToMaildirFlags() if err != nil { - logging.Errorf("could not sync maildir flags: %v", err) + log.Errorf("could not sync maildir flags: %v", err) } return nil }) @@ -325,13 +325,13 @@ func (db *DB) MsgModifyTags(key string, add, remove []string) error { for _, t := range add { err := msg.AddTag(t) if err != nil { - logging.Warnf("failed to add tag: %v", err) + log.Warnf("failed to add tag: %v", err) } } for _, t := range remove { err := msg.RemoveTag(t) if err != nil { - logging.Warnf("failed to remove tag: %v", err) + log.Warnf("failed to remove tag: %v", err) } } }) |