aboutsummaryrefslogtreecommitdiffstats
path: root/aerc.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-11-19 14:34:10 +0100
committerRobin Jarry <robin@jarry.cc>2022-11-21 13:18:34 +0100
commite5f2fb08d8a7604aeef726698ef696874bcd2561 (patch)
tree6927564ae1f016abc16bb9c5041969092c3ba10c /aerc.go
parent9db3710dd73b6949321a028b4dc2dc2277e97ce0 (diff)
downloadaerc-e5f2fb08d8a7604aeef726698ef696874bcd2561.tar.gz
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 <moritz@poldrack.dev> Suggested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'aerc.go')
-rw-r--r--aerc.go7
1 files changed, 2 insertions, 5 deletions
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