def __init__(
        self, publisher, errorStream, stdio, warningsModule,
        initialBufferSize=None,
    ):
        """
        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}
        """
        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: eventAsText(
                        event,
                        includeTimestamp=False,
                        includeSystem=False,
                    ) + '\n'
                ),
                [LogLevelFilterPredicate(defaultLogLevel=LogLevel.critical)]
            )
        )
        publisher.addObserver(self._temporaryObserver)
        self._oldshowwarning = warningsModule.showwarning

        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}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/_global.py