def logdebug(logger, msg, *args, **kwargs):
    '''
    Logs messages as DEBUG,
    unless show=True and esgfpid.defaults.LOG_SHOW_TO_INFO=True,
    (then it logs messages as INFO).
    '''
    if esgfpid.defaults.LOG_DEBUG_TO_INFO:
        logger.info('DEBUG %s ' % msg, *args, **kwargs)
    else:
        logger.debug(msg, *args, **kwargs)