Working to introduce structured logging to our tests. See #907
This work allows these test functions to be called by objects other
than *testing.T. The t.Error() calls are made compatible with
structured logging (wrapping Zap sugared logger calls) or code using
testing.T.
If the source is activator or autoscaler, we'd just print in the logstream
making it not very useful for searching.
Replace it with call site, if the controller is not set all.
/assign mattmoor
In our structured logging we use `logger.Errorw(..., zap.Error(err))` to log errors in a structured way. As such, they are not part of the actual log message. They are however of utmost importance when debugging issues so this adds `err={ERROR}` to the logline if the error key is present and not empty.
* Enrich the logs streamed in tests with useful information.
- Level is very useful to spot errors at a glance.
- Time is very helpful to be able to order the statements and notice time gaps.
- Key helps identifying which ressource is being reconciled (could be a child resource).
* Adjust timestamp, reduce level to only the first char.