Commit Graph

6 Commits

Author SHA1 Message Date
coryrc 9d8b936ca0 Switch *testing.T uses to equivalent interface + structured logging (#935)
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.
2019-12-13 10:22:54 -08:00
Victor Agababov a91557650e Fix the problem in kubelogs when source is not controller. (#634)
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
2019-09-04 21:00:04 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Markus Thömmes b3be0a29a2 Add 'error' field to extracted logs, if available. (#487)
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.
2019-06-24 06:53:04 -07:00
Markus Thömmes ca175939db Enrich the logs streamed in tests with useful information. (#480)
* 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.
2019-06-23 13:49:58 -07:00
Matt Moore d90a9bc97d Upstream the logstream package from knative/serving. (#472)
This also upstreams the utility for generating test resource names upon which it builds.
2019-06-18 20:29:46 -07:00