import logging


def get_logger(logger_name, propagate=True):
    """
    This function provides a simple wrapper to add a null handler to the logger
    requested so that we make sure not to dump stuff to terminal as defined by
    default configuration in case the library user do not want to use logging
    (or didn't care about configuring it).

    Args:
        logger_name (str): the logger instance name (usually the module name
                           with __name__)
        propagate (bool): whether to propagate the messages up to ancestor
                          loggers

    Returns:
        logging.Logger: Logger instance

    Raises:
        None
    """
    # if logger instance does not exist it will be created upon call
    logger = logging.getLogger(logger_name)
    logger.propagate = propagate

    # add the null handler to make sure nothing is written in case user didn't
    # configure logging
    logger.addHandler(logging.NullHandler())

    return logger