message: Mirror logging to stdout more consistently.
diff: @@ -20,6 +20,7 @@ from __future__ import print_function
  import os
  import sys
  +import traceback
  # TODO(mdan): Use a custom logger class.
  from tensorflow.python.platform import tf_logging as logging
  @@ -120,25 +121,27 @@ def has_verbosity(level):
  return get_verbosity() >= level
  +def _output_to_stdout(msg, *args, **kwargs):
  + print(msg % args)
  + if kwargs.get('exc_info', False):
  + traceback.print_exc()
  +
  +
  def error(level, msg, *args, **kwargs):
  if has_verbosity(level):
  logging.error(msg, *args, **kwargs)
  if echo_log_to_stdout:
  - print(msg % args)
  + _output_to_stdout('ERROR: ' + msg, *args, **kwargs)
  def log(level, msg, *args, **kwargs):
  if has_verbosity(level):
  logging.info(msg, *args, **kwargs)
  if echo_log_to_stdout:
  - print(msg % args)
  + _output_to_stdout(msg, *args, **kwargs)
  def warn(msg, *args, **kwargs):
  logging.warn(msg, *args, **kwargs)
  if echo_log_to_stdout:
  - print('WARNING:', msg % args)
  -
  -
  -def warn_first_n(msg, *args, **kwargs):
  - logging.log_first_n(logging.WARN, msg, *args, **kwargs)
  + _output_to_stdout('WARNING: ' + msg, *args, **kwargs)
  