import logging


def get_logger(logger_name):
    """
    Get logger to log information during code running

    :param logger_name: str, title of log file
    :return logger    : logger object

    Examples
    --------
    >>> logger_main = get_logger("main")
    >>> logger_main.info("Start . . .")
    """
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.INFO)
    file_handler = logging.FileHandler("{}.log".format(logger_name))
    file_handler.setLevel(logging.INFO)
    formatter = logging.Formatter("[%(levelname)s]%(asctime)s:%(name)s:%(message)s")
    file_handler.setFormatter(formatter)
    logger.addHandler(file_handler)
    return logger