'Logs deprecation message which is log level WARN if the
``removal_version`` is > 1 minor release away and log level ERROR
otherwise.
removal_version should be the version that the deprecated feature is
expected to be removed in, so something that will not exist in
version 1.7, but will in 1.6 would have a removal_version of 1.7.'

def deprecated(self, removal_version, msg, *args, **kwargs):

    from pip import __version__
    if should_warn(__version__, removal_version):
        self.warn(msg, *args, **kwargs)
    else:
        self.error(msg, *args, **kwargs)
