'Observe warning events and write them to C{self._stream}.
This method is a log observer which will be registered with
C{self._publisher.addObserver}.
@param event: A C{dict} from the logging system.  If it has a
C{\'warning\'} key, a logged warning will be extracted from it and
possibly written to C{self.stream}.'

def _observeWarnings(self, event):

    if ('warning' in event):
        key = (event['filename'], event['lineno'], event['category'].split('.')[(-1)], str(event['warning']))
        if (key not in self._warningCache):
            self._warningCache.add(key)
            self._stream.write(('%s:%s:    %s:    %s\n' % key))
