Skip to content

Commit

Permalink
Add tip about being able to debug a bunch of variables without format…
Browse files Browse the repository at this point in the history
…ting hassle (#162)
  • Loading branch information
MadLittleMods authored Jul 23, 2021
1 parent 25fbea7 commit e44c083
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ There is no syntactically pleasing way to do this. Create a separate function wh

This is done using standard Go testing mechanisms, use `t.Logf(...)` which will be logged only if the test fails or if `-v` is set. Note that you will not need to log HTTP requests performed using one of the built in deployment clients as they are already wrapped in loggers. For full HTTP logs, use `COMPLEMENT_DEBUG=1`.

For debugging, you can also use `logrus` to expand a bunch of variables:

```go
logrus.WithFields(logrus.Fields{
"events": events,
"context": context,
}).Error("message response")
```

### How do I show the server logs even when the tests pass?

Expand Down

0 comments on commit e44c083

Please sign in to comment.