import functools


def deprecated(date, old, instead):
  """A decorator to print log of api change.
  """
  def log_decorator(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
      print('[WARNING] %s will not be supported after %s,'
            ' please use %s instead.' % (old, date, instead))
      return func(*args, **kwargs)
    return wrapper
  return log_decorator