'Create handler from filename, an open stream or `None` (stderr).'

def _detect_handler(self, logfile=None):

    logfile = (sys.__stderr__ if (logfile is None) else logfile)
    if hasattr(logfile, u'write'):
        return logging.StreamHandler(logfile)
    return WatchedFileHandler(logfile)
