Can't mock logger anymore
After https://github.com/src-d/lookout/pull/439 it's impossible to mock logger in tests anymore.
Is there any more context? are tests failing? Any specific place where we need to mock a logger?
Tests are failing obviously.
As a solution, we can do in ctxlog/context.go:
var NewLogger = log.New
then we will be able to mock it in the tests. What do you think @carlosms ?
It looks risk... but we can go that way to unblock the issue and maybe rethink later if we find a better solution.
Can't we change the go-log DefaultFactory instead? I think it should be picked by ctxlog.Get -> log.New
Sadly we can not. LoggerFactory isn't an interface but a struct defined in go-log. And there is no way to replace logrus in New with something else.
I'll proceed with the solution from above to unblock related PR but keep this issue open because I don't like this solution too much.