Merge pull request #4264 from joostjager/itest-err-detector-doc

doc: describe usage of log levels
This commit is contained in:
Joost Jager 2020-06-16 16:33:50 +02:00 committed by GitHub
commit 4a7cefdab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@
4.7. [Protobuf Compilation](#Protobuf)<br />
4.8. [Additional Style Constraints On Top of gofmt](ExtraGoFmtStyle)<br />
4.9. [Pointing to Remote Dependant Branches in Go Modules](ModulesReplace)<br />
4.10. [Use of Log Levels](#LogLevels)<br />
5. [Code Approval Process](#CodeApproval)<br />
5.1. [Code Review](#CodeReview)<br />
5.2. [Rework Code (if needed)](#CodeRework)<br />
@ -166,6 +167,8 @@ A quick summary of test practices follows:
[`networkHarness`framework](https://github.com/lightningnetwork/lnd/blob/master/lntest/harness.go)
contained within `lnd`. For example integration tests, see
[`lnd_test.go`](https://github.com/lightningnetwork/lnd/blob/master/lnd_test.go#L181).
- The itest log files are automatically scanned for `[ERR]` lines. There
shouldn't be any of those in the logs, see [Use of Log Levels](#LogLevels).
Throughout the process of contributing to `lnd`, you'll likely also be
extensively using the commands within our `Makefile`. As a result, we recommend
@ -512,6 +515,16 @@ Here's an example replacing the `lightning-onion` version checked into `lnd` wit
go mod edit -replace=github.com/lightningnetwork/lightning-onion@v0.0.0-20180605012408-ac4d9da8f1d6=github.com/roasbeef/lightning-onion@2e5ae87696046298365ab43bcd1cf3a7a1d69695
```
<a name="LogLevels" />
#### 4.10 Use of Log Levels
There are six log levels available: `trace`, `debug`, `info`, `warn`, `error` and `critical`.
Only use `error` for internal errors that are never expected to happen during
normal operation. No event triggered by external sources (rpc, chain backend,
etc) should lead to an `error` log.
<a name="CodeApproval" />
### 5. Code Approval Process