aboutsummaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-11-23 10:43:44 +0100
committerRobin Jarry <robin@jarry.cc>2022-12-02 22:10:44 +0100
commit70f46757449c8f24b818f4dfc5dcb87da7e327d6 (patch)
treea8650017ccdae1f7a4aebbdf745a0fa4ae2c2286 /CONTRIBUTING.md
parent3cd69ee953b169cf2e61b70948582df4a75cffc5 (diff)
downloadaerc-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 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4b93682f..03c606ac 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -240,6 +240,23 @@ by running `make fmt`.
If gofumpt accepts your code it's most likely properly formatted.
+### Logging
+
+Aerc allows logging messages to a file. Either by redirecting the output to
+a file (e.g. `aerc > log`), or by configuring `log-file` in ``aerc.conf`.
+Logging messages are associated with a severity level, from lowest to highest:
+`trace`, `debug`, `info`, `warn`, `error`.
+
+Messages can be sent to the log file by using the following functions:
+
+- `logging.Errorf()`: Use to report serious (but non-fatal) errors.
+- `logging.Warnf()`: Use to report issues that do not affect normal use.
+- `logging.Infof()`: Use to display important messages that may concern
+ non-developers.
+- `logging.Debugf()`: Use to display non-important messages, or debuging
+ details.
+- `logging.Tracef()`: Use to display only low level debugging traces.
+
### Man pages
All `doc/*.scd` files are written in the [scdoc][scdoc] format and compiled to