aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-11-23 10:43:44 +0100
committerRobin Jarry <robin@jarry.cc>2022-12-02 22:10:44 +0100
commit70f46757449c8f24b818f4dfc5dcb87da7e327d6 (patch)
treea8650017ccdae1f7a4aebbdf745a0fa4ae2c2286 /lib/crypto
parent3cd69ee953b169cf2e61b70948582df4a75cffc5 (diff)
downloadaerc-70f46757449c8f24b818f4dfc5dcb87da7e327d6.tar.gz
logging: homogenize levels
The main goal is to ensure that by default, the log file (if configured) does not grow out of proportions. Most of the logging messages in aerc are actually for debugging and/or trace purposes. Define clear rules for logging levels. Enforce these rules everywhere. After this patch, here is what the log file looks like after starting up with a single account: INFO 2022/11/24 20:26:16.147164 aerc.go:176: Starting up version 0.13.0-100-g683981479c60 (go1.18.7 amd64 linux) INFO 2022/11/24 20:26:17.546448 account.go:254: [work] connected. 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.go2
-rw-r--r--lib/crypto/pgp/pgp.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/crypto/gpg/gpgbin/gpgbin.go b/lib/crypto/gpg/gpgbin/gpgbin.go
index 1e8c7dcd..d83c45fb 100644
--- a/lib/crypto/gpg/gpgbin/gpgbin.go
+++ b/lib/crypto/gpg/gpgbin/gpgbin.go
@@ -129,7 +129,7 @@ func parse(r io.Reader, md *models.MessageDetails) error {
}
if strings.HasPrefix(line, "[GNUPG:]") {
msgCollecting = false
- logging.Debugf(line)
+ logging.Tracef(line)
}
if msgCollecting {
msgContent = append(msgContent, scanner.Bytes()...)
diff --git a/lib/crypto/pgp/pgp.go b/lib/crypto/pgp/pgp.go
index f5612eea..fd9d13eb 100644
--- a/lib/crypto/pgp/pgp.go
+++ b/lib/crypto/pgp/pgp.go
@@ -29,7 +29,7 @@ var (
)
func (m *Mail) Init() error {
- logging.Infof("Initializing PGP keyring")
+ logging.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)