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 /lib/crypto | |
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 'lib/crypto')
-rw-r--r-- | lib/crypto/gpg/gpgbin/gpgbin.go | 8 | ||||
-rw-r--r-- | lib/crypto/pgp/pgp.go | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/crypto/gpg/gpgbin/gpgbin.go b/lib/crypto/gpg/gpgbin/gpgbin.go index d83c45fb..a83ebb37 100644 --- a/lib/crypto/gpg/gpgbin/gpgbin.go +++ b/lib/crypto/gpg/gpgbin/gpgbin.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" ) @@ -65,7 +65,7 @@ func getIdentity(key uint64) string { cmd.Stdout = &outbuf err := cmd.Run() if err != nil { - logging.Errorf("gpg: failed to get identity: %v", err) + log.Errorf("gpg: failed to get identity: %v", err) return "" } out := strings.Split(outbuf.String(), "\n") @@ -91,7 +91,7 @@ func getKeyId(s string, private bool) string { cmd.Stdout = &outbuf err := cmd.Run() if err != nil { - logging.Errorf("gpg: failed to get key ID: %v", err) + log.Errorf("gpg: failed to get key ID: %v", err) return "" } out := strings.Split(outbuf.String(), "\n") @@ -129,7 +129,7 @@ func parse(r io.Reader, md *models.MessageDetails) error { } if strings.HasPrefix(line, "[GNUPG:]") { msgCollecting = false - logging.Tracef(line) + log.Tracef(line) } if msgCollecting { msgContent = append(msgContent, scanner.Bytes()...) diff --git a/lib/crypto/pgp/pgp.go b/lib/crypto/pgp/pgp.go index fd9d13eb..b2f5fa24 100644 --- a/lib/crypto/pgp/pgp.go +++ b/lib/crypto/pgp/pgp.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "git.sr.ht/~rjarry/aerc/logging" + "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "github.com/ProtonMail/go-crypto/openpgp" "github.com/ProtonMail/go-crypto/openpgp/armor" @@ -29,7 +29,7 @@ var ( ) func (m *Mail) Init() error { - logging.Debugf("Initializing PGP keyring") + log.Debugf("Initializing PGP keyring") err := os.MkdirAll(path.Join(xdg.DataHome(), "aerc"), 0o700) if err != nil { return fmt.Errorf("failed to create data directory: %w", err) |