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/account | |
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/account')
-rw-r--r-- | commands/account/export-mbox.go | 2 | ||||
-rw-r--r-- | commands/account/import-mbox.go | 4 | ||||
-rw-r--r-- | commands/account/search.go | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/commands/account/export-mbox.go b/commands/account/export-mbox.go index b68e1cc5..f51608b9 100644 --- a/commands/account/export-mbox.go +++ b/commands/account/export-mbox.go @@ -117,7 +117,7 @@ func (ExportMbox) Execute(aerc *widgets.Aerc, args []string) error { } statusInfo := fmt.Sprintf("Exported %d of %d messages to %s.", ctr, len(store.Uids()), filename) aerc.PushStatus(statusInfo, 10*time.Second) - logging.Infof(statusInfo) + logging.Debugf(statusInfo) }() return nil diff --git a/commands/account/import-mbox.go b/commands/account/import-mbox.go index 5a8a2ee6..93408aca 100644 --- a/commands/account/import-mbox.go +++ b/commands/account/import-mbox.go @@ -55,7 +55,7 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { importFolder := func() { statusInfo := fmt.Sprintln("Importing", filename, "to folder", folder) aerc.PushStatus(statusInfo, 10*time.Second) - logging.Infof(statusInfo) + logging.Debugf(statusInfo) f, err := os.Open(filename) if err != nil { aerc.PushError(err.Error()) @@ -123,7 +123,7 @@ func (ImportMbox) Execute(aerc *widgets.Aerc, args []string) error { } } infoStr := fmt.Sprintf("%s: imported %d of %d sucessfully.", args[0], appended, len(messages)) - logging.Infof(infoStr) + logging.Debugf(infoStr) aerc.SetStatus(infoStr) } diff --git a/commands/account/search.go b/commands/account/search.go index b4942bf5..125cb5d7 100644 --- a/commands/account/search.go +++ b/commands/account/search.go @@ -44,7 +44,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { cb := func(msg types.WorkerMessage) { if _, ok := msg.(*types.Done); ok { acct.SetStatus(statusline.FilterResult(strings.Join(args, " "))) - logging.Infof("Filter results: %v", store.Uids()) + logging.Tracef("Filter results: %v", store.Uids()) } } store.Sort(store.GetCurrentSortCriteria(), cb) @@ -52,7 +52,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error { acct.SetStatus(statusline.Search("Searching...")) cb := func(uids []uint32) { acct.SetStatus(statusline.Search(strings.Join(args, " "))) - logging.Infof("Search results: %v", uids) + logging.Tracef("Search results: %v", uids) store.ApplySearch(uids) // TODO: Remove when stores have multiple OnUpdate handlers ui.Invalidate() |