Skip to content

Commit 004eb29

Browse files
committed
Add tip about being able to debug a bunch of variables without formatting hassle
1 parent 91b0879 commit 004eb29

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ONBOARDING.md

+9
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ There is no syntactically pleasing way to do this. Create a separate function wh
163163

164164
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`.
165165

166+
For debugging, you can also use `logrus` to expand a bunch of variables:
167+
168+
```go
169+
logrus.WithFields(logrus.Fields{
170+
"events": events,
171+
"context": context,
172+
}).Error("message response")
173+
```
174+
166175
### How do I skip a test?
167176

168177
Use one of `t.Skipf(...)` or `t.SkipNow()`.

0 commit comments

Comments
 (0)