From e5f2fb08d8a7604aeef726698ef696874bcd2561 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sat, 19 Nov 2022 14:34:10 +0100 Subject: config: add log-file and log-level settings Allow configuring persistent logging to file with a log level. When redirecting the output of aerc to a file these two settings are ignored and all messages are printed to stdout. Suggested-by: Moritz Poldrack Suggested-by: Tim Culverhouse Signed-off-by: Robin Jarry Acked-by: Tim Culverhouse --- aerc.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'aerc.go') diff --git a/aerc.go b/aerc.go index 1826567f..09ddc43f 100644 --- a/aerc.go +++ b/aerc.go @@ -167,17 +167,14 @@ func main() { retryExec = true } - if !isatty.IsTerminal(os.Stdout.Fd()) { - logging.Init() - } - logging.Infof("Starting up version %s", logging.BuildInfo) - conf, err := config.LoadConfigFromFile(nil, accts) if err != nil { fmt.Fprintf(os.Stderr, "Failed to load config: %v\n", err) os.Exit(1) //nolint:gocritic // PanicHandler does not need to run as it's not a panic } + logging.Infof("Starting up version %s", logging.BuildInfo) + var ( aerc *widgets.Aerc ui *libui.UI -- cgit