import logging


def getLogger(plugin_name=None):
    """Get logger object.

    This function is needed just to standardize logger names and
    ensure that all log objects belong to vitables which was properly
    configured.

    :parameter plugin_name: the name that will be used in log output
    to identify the source

    :return: logger object
    """

    logger_name = 'vitables'
    if plugin_name is not None:
        logger_name += '.plugin.' + plugin_name
    logger = logging.getLogger(logger_name)
    return logger