Skip to content

Commit

Permalink
Merge pull request #4264 from joostjager/itest-err-detector-doc
Browse files Browse the repository at this point in the history
doc: describe usage of log levels
  • Loading branch information
joostjager authored Jun 16, 2020
2 parents 3c48cab + d1e049f commit 4a7cefd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/code_contribution_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 />
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4a7cefd

Please sign in to comment.