'Initialize this L{LogBeginner}.
@param initialBufferSize: The size of the event buffer into which
events are collected until C{beginLoggingTo} is called.  Or
C{None} to use the default size.
@type initialBufferSize: L{int} or L{types.NoneType}'

def __init__(self, publisher, errorStream, stdio, warningsModule, initialBufferSize=None):

    if (initialBufferSize is None):
        initialBufferSize = self._DEFAULT_BUFFER_SIZE
    self._initialBuffer = LimitedHistoryLogObserver(size=initialBufferSize)
    self._publisher = publisher
    self._log = Logger(observer=publisher)
    self._stdio = stdio
    self._warningsModule = warningsModule
    self._temporaryObserver = LogPublisher(self._initialBuffer, FilteringLogObserver(FileLogObserver(errorStream, (lambda event: (formatEvent(event) + u'\n'))), [LogLevelFilterPredicate(defaultLogLevel=LogLevel.critical)]))
    publisher.addObserver(self._temporaryObserver)
    self._oldshowwarning = warningsModule.showwarning
