FakeLogger is broken

Bug #302183 reported by Barry Warsaw
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

lib/canonical/launchpad/scripts/logger.py contains a FakeLogger that claims:

    """Emulates a proper logger, just printing everything out to stdout.
    Used exclusively in doc tests."""

Sadly, it does not "emulate[] a proper logger" because it does not interpolate the positional arguments into a format string. Thus, this horror is necessary to capture logger output for tests:

    def message(self, prefix, *stuff, **kws):
        fmt = stuff[0]
        print >> self.io, prefix, fmt % stuff[1:]

We should fix FakeLogger to actually emulate the builtin logger, and we should also consolidate our testing loggers so that we have but one in our tree.

Curtis Hovey (sinzui)
Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.