diff options
author | Robin Jarry <robin@jarry.cc> | 2022-11-23 10:43:44 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-12-02 22:10:44 +0100 |
commit | 70f46757449c8f24b818f4dfc5dcb87da7e327d6 (patch) | |
tree | a8650017ccdae1f7a4aebbdf745a0fa4ae2c2286 /commands/msg | |
parent | 3cd69ee953b169cf2e61b70948582df4a75cffc5 (diff) | |
download | aerc-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 'commands/msg')
-rw-r--r-- | commands/msg/forward.go | 2 | ||||
-rw-r--r-- | commands/msg/recall.go | 4 | ||||
-rw-r--r-- | commands/msg/unsubscribe.go | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go index ccfaa086..74ee6575 100644 --- a/commands/msg/forward.go +++ b/commands/msg/forward.go @@ -74,7 +74,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { return err } - logging.Infof("Forwarding email %s", msg.Envelope.MessageId) + logging.Debugf("Forwarding email <%s>", msg.Envelope.MessageId) h := &mail.Header{} subject := "Fwd: " + msg.Envelope.Subject diff --git a/commands/msg/recall.go b/commands/msg/recall.go index b5c92f21..eb8195f8 100644 --- a/commands/msg/recall.go +++ b/commands/msg/recall.go @@ -70,7 +70,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { return errors.Wrap(err, "Recall failed") } - logging.Infof("Recalling message %s", msgInfo.Envelope.MessageId) + logging.Debugf("Recalling message <%s>", msgInfo.Envelope.MessageId) composer, err := widgets.NewComposer(aerc, acct, aerc.Config(), acct.AccountConfig(), acct.Worker(), "", msgInfo.RFC822Headers, @@ -200,7 +200,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error { } bs, err := msg.BodyStructure().PartAtIndex(p) if err != nil { - logging.Infof("cannot get PartAtIndex %v: %v", p, err) + logging.Warnf("cannot get PartAtIndex %v: %v", p, err) continue } msg.FetchBodyPart(p, func(reader io.Reader) { diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go index 022135eb..72c839fe 100644 --- a/commands/msg/unsubscribe.go +++ b/commands/msg/unsubscribe.go @@ -56,10 +56,10 @@ func (Unsubscribe) Execute(aerc *widgets.Aerc, args []string) error { if len(methods) == 0 { return fmt.Errorf("no methods found to unsubscribe") } - logging.Infof("unsubscribe: found %d methods", len(methods)) + logging.Debugf("unsubscribe: found %d methods", len(methods)) unsubscribe := func(method *url.URL) { - logging.Infof("unsubscribe: trying to unsubscribe using %s", method.Scheme) + logging.Debugf("unsubscribe: trying to unsubscribe using %s", method.Scheme) var err error switch strings.ToLower(method.Scheme) { case "mailto": |