aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-12-06 17:59:52 +0100
committerRobin Jarry <robin@jarry.cc>2022-12-07 00:45:44 +0100
commitbf713a89d1e8127c02a9680889b5c88809a26f2b (patch)
treea737948af44dae6f3e5bbe031224e4b9f713f0a3
parentd25efff65aba373be44d1a514c35472bf52994e5 (diff)
downloadaerc-bf713a89d1e8127c02a9680889b5c88809a26f2b.tar.gz
log: force trace level when using shell redirection
When using aerc > log, print all messages as it was before the logging system cleanup. Requested-by: Tim Culverhouse <tim@timculverhouse.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
-rw-r--r--config/aerc.conf6
-rw-r--r--config/general.go4
-rw-r--r--doc/aerc-config.5.scd2
3 files changed, 6 insertions, 6 deletions
diff --git a/config/aerc.conf b/config/aerc.conf
index 8f3fd097..ecae5b90 100644
--- a/config/aerc.conf
+++ b/config/aerc.conf
@@ -31,9 +31,9 @@
#log-file=
# Only log messages above the specified level to log-file. Supported levels
-# are: debug, info, warn and error. When redirecting aerc's output to a file
-# using > shell redirection, this setting is ignored and the log level is
-# forced to debug.
+# are: trace, debug, info, warn and error. When redirecting aerc's output to
+# a file using > shell redirection, this setting is ignored and the log level
+# is forced to trace.
#
# Default: info
#log-level=info
diff --git a/config/general.go b/config/general.go
index b06eddde..2c09a14e 100644
--- a/config/general.go
+++ b/config/general.go
@@ -51,8 +51,8 @@ func (config *AercConfig) parseGeneral(file *ini.File) error {
end:
if !isatty.IsTerminal(os.Stdout.Fd()) {
logFile = os.Stdout
- // redirected to file, force DEBUG level
- config.General.LogLevel = log.DEBUG
+ // redirected to file, force TRACE level
+ config.General.LogLevel = log.TRACE
} else if config.General.LogFile != "" {
path, err := homedir.Expand(config.General.LogFile)
if err != nil {
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index e7000b4c..868f6564 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -58,7 +58,7 @@ These options are configured in the *[general]* section of _aerc.conf_.
Only log messages above the specified level to *log-file*. Supported
levels are: _trace_, _debug_, _info_, _warn_ and _error_. When
redirecting aerc's output to a file using _>_ shell redirection, this
- setting is ignored and the log level is forced to _debug_.
+ setting is ignored and the log level is forced to _trace_.
Default: _info_