Return logging function.

    When logging function called, will return True if action should be skipped.
    Log will indicate if skipped because of dry run.

def skipDryRun(logger, dryRun, level=logging.DEBUG):
    """ Return logging function.

    When logging function called, will return True if action should be skipped.
    Log will indicate if skipped because of dry run.
    """
    # This is an undocumented "feature" of logging module:
    # logging.log() requires a numeric level
    # logging.getLevelName() maps names to numbers
    if not isinstance(level, int):
        level = logging.getLevelName(level)
    return (
        functools.partial(_logDryRun, logger, level) if dryRun
        else functools.partial(logger.log, level)
    )