Closed williammartin closed 5 years ago
:white_check_mark: Hey williammartin! The commit authors and yourself have already signed the CLA.
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/165100989
The labels on this github issue will be updated when the story is started.
Thank you for yet another great PR!
We discussed the change and we agree with the points you made. We would also prefer to have an interface for the logger, instead of passing a plain io.Writer
. One option (which we already use in some places) is lager.
We'll merge this and throw a chore in our tracker to eventually use lager
everywhere.
Feel free to PR the metrics collector
code if you wish, preferably with lager
.
@gdankov & @JulzDiverse
The route emitter structure has a few
fmt.Println
s sprinkled around. This is not ideal for a couple of reasons:stdout
, which is confusing when all the tests are actually passing.This PR introduces a log to the
Emitter
struct that can be injected. In tests we then multiwriter to a buffer we can assert on (turns out, these error logs were not actually being tested), and to the GinkgoWriter, so if a test fails we still get the output.A few further notes on this:
stdout
at all, but I didn't change it tostderr
because that would be a behavioural change.logger
interface, but that can be changed later.This problem is also in the
metrics
emitter, but I didn't fix it there in case you reject this.