from tensorflow.python.eager import context

_already_logged = set()


def _eager_log(level, *args):
  if context.in_eager_mode() and args in _already_logged:
    return
  _already_logged.add(args)
  getattr(tf.logging, level)(*args)
