import logging


def create_stream_handler(level, stream, formatter):
    """
    Helper function for get_logger.
    Creates a stream handler for console logging output.
    """

    handler = logging.StreamHandler(stream)
    handler.setFormatter(formatter)
    handler.setLevel(level)
    return handler