'Add a log observer which records log events in C{self.out}.  Also,
make sure the default string encoding is ASCII so that
L{testSingleUnicode} can test the behavior of logging unencodable
unicode messages.'

def setUp(self):

    self.out = FakeFile()
    self.lp = log.LogPublisher()
    self.flo = log.FileLogObserver(self.out)
    self.lp.addObserver(self.flo.emit)
    try:
        str(u'\xbd')
    except UnicodeEncodeError:
        self._origEncoding = None
    else:
        if _PY3:
            self._origEncoding = None
            return
        reload(sys)
        self._origEncoding = sys.getdefaultencoding()
        sys.setdefaultencoding('ascii')
