import logging


def get_console_handler(console_log_level):
    """
        Creates a file handler.

        Args:
            console_log_level:  minimum level for file terminal

        Returns:
            the handler
    """

    handler = logging.StreamHandler()
    handler.setLevel(console_log_level)
    mformat = "%(levelname)-8s [%(asctime)s] %(name)-20s %(message)s"
    handler.setFormatter(logging.Formatter(mformat, datefmt="%Y-%m-%d %H:%M:%S"))

    return handler