Skip to content

Commit e44c083

Browse files
Add tip about being able to debug a bunch of variables without formatting hassle (#162)
1 parent 25fbea7 commit e44c083

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ONBOARDING.md

+8
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ There is no syntactically pleasing way to do this. Create a separate function wh
173173

174174
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`.
175175

176+
For debugging, you can also use `logrus` to expand a bunch of variables:
177+
178+
```go
179+
logrus.WithFields(logrus.Fields{
180+
"events": events,
181+
"context": context,
182+
}).Error("message response")
183+
```
176184

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

0 commit comments

Comments
 (0)