[bug 827355] Fix stdout printing for search commands

This also moves the FakeLogger to utils.