From 70f46757449c8f24b818f4dfc5dcb87da7e327d6 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 23 Nov 2022 10:43:44 +0100 Subject: 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 Tested-by: Bence Ferdinandy Acked-by: Tim Culverhouse --- commands/account/import-mbox.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'commands/account/import-mbox.go') 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) } -- cgit