aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <nobody@tensorflow.org>2016-04-22 05:25:14 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-04-22 06:32:06 -0700
commit455a27f0a64753fc83d7d91b6b33881dfcf63679 (patch)
tree86098273500a6d2f6a1eb9dff342f2e760abf03f
parent67ade17f6bfb4f9b799ab0755800262c5e821dc7 (diff)
Rename python/platform/logging.py to python/platform/tf_logging to simplify future platform refactorings
Change: 120541613
-rw-r--r--tensorflow/contrib/framework/python/ops/variables.py2
-rw-r--r--tensorflow/contrib/layers/python/layers/regularizers.py2
-rw-r--r--tensorflow/python/BUILD19
-rw-r--r--tensorflow/python/__init__.py2
-rw-r--r--tensorflow/python/client/graph_util.py2
-rw-r--r--tensorflow/python/client/session.py2
-rw-r--r--tensorflow/python/client/timeline.py2
-rw-r--r--tensorflow/python/framework/ops.py2
-rw-r--r--tensorflow/python/framework/registry.py2
-rw-r--r--tensorflow/python/framework/test_util.py2
-rw-r--r--tensorflow/python/kernel_tests/gradient_checker.py2
-rw-r--r--tensorflow/python/ops/control_flow_ops.py2
-rw-r--r--tensorflow/python/ops/gradients.py2
-rw-r--r--tensorflow/python/ops/op_def_library.py2
-rw-r--r--tensorflow/python/ops/partitioned_variables.py2
-rw-r--r--tensorflow/python/ops/rnn_cell.py2
-rw-r--r--tensorflow/python/ops/template.py2
-rw-r--r--tensorflow/python/ops/variable_scope.py2
-rw-r--r--tensorflow/python/platform/flags_test.py4
-rw-r--r--tensorflow/python/platform/gfile_test.py6
-rw-r--r--tensorflow/python/platform/logging.py208
-rw-r--r--tensorflow/python/platform/logging_test.py4
-rw-r--r--tensorflow/python/platform/resource_loader.py2
-rw-r--r--tensorflow/python/platform/resource_loader_test.py2
-rw-r--r--tensorflow/python/platform/tf_logging.py (renamed from tensorflow/python/platform/default/_logging.py)2
-rw-r--r--tensorflow/python/summary/event_accumulator.py2
-rw-r--r--tensorflow/python/summary/event_accumulator_test.py2
-rw-r--r--tensorflow/python/summary/event_multiplexer.py2
-rw-r--r--tensorflow/python/summary/impl/directory_watcher.py2
-rw-r--r--tensorflow/python/summary/impl/event_file_loader.py2
-rw-r--r--tensorflow/python/summary/impl/gcs.py2
-rw-r--r--tensorflow/python/summary/impl/gcs_file_loader.py2
-rw-r--r--tensorflow/python/training/coordinator.py2
-rw-r--r--tensorflow/python/training/device_setter.py2
-rw-r--r--tensorflow/python/training/queue_runner.py2
-rw-r--r--tensorflow/python/training/saver.py2
-rw-r--r--tensorflow/python/training/session_manager.py2
-rw-r--r--tensorflow/python/training/summary_io.py2
-rw-r--r--tensorflow/python/training/supervisor.py2
-rw-r--r--tensorflow/python/training/sync_replicas_optimizer.py2
-rw-r--r--tensorflow/python/training/tensorboard_logging.py2
-rw-r--r--tensorflow/python/training/tensorboard_logging_test.py2
-rw-r--r--tensorflow/tensorboard/backend/handler.py2
-rw-r--r--tensorflow/tensorboard/backend/server.py2
-rw-r--r--tensorflow/tensorboard/tensorboard.py2
45 files changed, 51 insertions, 270 deletions
diff --git a/tensorflow/contrib/framework/python/ops/variables.py b/tensorflow/contrib/framework/python/ops/variables.py
index 418990bf4d..2620afb2b3 100644
--- a/tensorflow/contrib/framework/python/ops/variables.py
+++ b/tensorflow/contrib/framework/python/ops/variables.py
@@ -26,7 +26,7 @@ from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import variables
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
__all__ = [
'assert_global_step', 'create_global_step', 'get_global_step',
diff --git a/tensorflow/contrib/layers/python/layers/regularizers.py b/tensorflow/contrib/layers/python/layers/regularizers.py
index a0639a6aae..d50152da50 100644
--- a/tensorflow/contrib/layers/python/layers/regularizers.py
+++ b/tensorflow/contrib/layers/python/layers/regularizers.py
@@ -24,7 +24,7 @@ from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn
from tensorflow.python.ops import standard_ops
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
__all__ = ['l1_regularizer', 'l2_regularizer', 'sum_regularizer',
'apply_regularization']
diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index 632f670a20..0eb712c186 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -39,7 +39,7 @@ py_library(
py_library(
name = "platform",
- srcs = glob(["platform/**/*.py"]),
+ srcs = glob(["platform/*.py"]),
srcs_version = "PY2AND3",
deps = ["//tensorflow/core:protos_all_py"],
)
@@ -47,7 +47,6 @@ py_library(
py_library(
name = "platform_test",
srcs = [
- "platform/default/_googletest.py",
"platform/googletest.py",
],
srcs_version = "PY2AND3",
@@ -58,25 +57,13 @@ py_library(
)
py_tests(
- name = "default_platform_tests",
+ name = "platform_tests",
size = "small",
- srcs = glob(["platform/default/*_test.py"]),
+ srcs = glob(["platform/*_test.py"]),
additional_deps = [
":platform",
":platform_test",
],
- prefix = "default_platform",
-)
-
-py_tests(
- name = "google_platform_tests",
- size = "small",
- srcs = glob(["platform/google/*_test.py"]),
- additional_deps = [
- ":platform",
- ":platform_test",
- ],
- prefix = "google_platform",
)
cc_library(
diff --git a/tensorflow/python/__init__.py b/tensorflow/python/__init__.py
index 50be1c0d47..27631ba7dc 100644
--- a/tensorflow/python/__init__.py
+++ b/tensorflow/python/__init__.py
@@ -88,7 +88,7 @@ from tensorflow.python.lib.io import python_io
from tensorflow.python.platform import app
from tensorflow.python.platform import flags
from tensorflow.python.platform import gfile
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.platform import resource_loader
from tensorflow.python.platform import sysconfig
from tensorflow.python.platform import test
diff --git a/tensorflow/python/client/graph_util.py b/tensorflow/python/client/graph_util.py
index eaaf90d7f3..969b936393 100644
--- a/tensorflow/python/client/graph_util.py
+++ b/tensorflow/python/client/graph_util.py
@@ -27,7 +27,7 @@ from tensorflow.python.framework import device as pydev
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_util
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
_VARIABLE_OPS = {
"Assign",
diff --git a/tensorflow/python/client/session.py b/tensorflow/python/client/session.py
index c82f075e06..8f87a6fead 100644
--- a/tensorflow/python/client/session.py
+++ b/tensorflow/python/client/session.py
@@ -28,7 +28,7 @@ from tensorflow.python import pywrap_tensorflow as tf_session
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.ops import session_ops
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
diff --git a/tensorflow/python/client/timeline.py b/tensorflow/python/client/timeline.py
index ebffc143dc..59e46bb449 100644
--- a/tensorflow/python/client/timeline.py
+++ b/tensorflow/python/client/timeline.py
@@ -27,7 +27,7 @@ import six # pylint: disable=unused-import
# The timeline target is usually imported as part of BUILD target
# "platform_test", which includes also includes the "platform"
# dependency. This is why the logging import here is okay.
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
class AllocationMaximum(collections.namedtuple(
diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py
index 70ff2b6c53..f3ba9687e6 100644
--- a/tensorflow/python/framework/ops.py
+++ b/tensorflow/python/framework/ops.py
@@ -38,7 +38,7 @@ from tensorflow.python.framework import dtypes
from tensorflow.python.framework import registry
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import versions
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
diff --git a/tensorflow/python/framework/registry.py b/tensorflow/python/framework/registry.py
index c1a1013152..869e982b11 100644
--- a/tensorflow/python/framework/registry.py
+++ b/tensorflow/python/framework/registry.py
@@ -25,7 +25,7 @@ from __future__ import print_function
import traceback
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
diff --git a/tensorflow/python/framework/test_util.py b/tensorflow/python/framework/test_util.py
index ca611c2c7d..624012f4de 100644
--- a/tensorflow/python/framework/test_util.py
+++ b/tensorflow/python/framework/test_util.py
@@ -39,7 +39,7 @@ from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.framework import versions
from tensorflow.python.platform import googletest
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
from tensorflow.python.util.protobuf import compare
diff --git a/tensorflow/python/kernel_tests/gradient_checker.py b/tensorflow/python/kernel_tests/gradient_checker.py
index cecc163438..acbedf01aa 100644
--- a/tensorflow/python/kernel_tests/gradient_checker.py
+++ b/tensorflow/python/kernel_tests/gradient_checker.py
@@ -29,7 +29,7 @@ from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import constant_op
from tensorflow.python.ops import gradients
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
def _product(t):
diff --git a/tensorflow/python/ops/control_flow_ops.py b/tensorflow/python/ops/control_flow_ops.py
index 36197fb5b7..2acd7d7d73 100644
--- a/tensorflow/python/ops/control_flow_ops.py
+++ b/tensorflow/python/ops/control_flow_ops.py
@@ -91,7 +91,7 @@ from tensorflow.python.ops import tensor_array_ops
# pylint: disable=wildcard-import,undefined-variable
from tensorflow.python.ops.gen_control_flow_ops import *
# pylint: enable=wildcard-import
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
# We override the 'tuple' for a control flow op, so we keep python's
diff --git a/tensorflow/python/ops/gradients.py b/tensorflow/python/ops/gradients.py
index c516948f98..9768db4989 100644
--- a/tensorflow/python/ops/gradients.py
+++ b/tensorflow/python/ops/gradients.py
@@ -42,7 +42,7 @@ from tensorflow.python.ops import math_ops
from tensorflow.python.ops import linalg_ops
from tensorflow.python.ops import functional_ops
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
# Warn the user if we convert a sparse representation to dense with at
# least this number of elements.
diff --git a/tensorflow/python/ops/op_def_library.py b/tensorflow/python/ops/op_def_library.py
index f7150d4f39..c6638a4b68 100644
--- a/tensorflow/python/ops/op_def_library.py
+++ b/tensorflow/python/ops/op_def_library.py
@@ -32,7 +32,7 @@ from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import constant_op
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
diff --git a/tensorflow/python/ops/partitioned_variables.py b/tensorflow/python/ops/partitioned_variables.py
index 4e4d1345f2..94870ef5dd 100644
--- a/tensorflow/python/ops/partitioned_variables.py
+++ b/tensorflow/python/ops/partitioned_variables.py
@@ -59,7 +59,7 @@ import six # pylint: disable=unused-import
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import variable_scope
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
__all__ = ["create_partitioned_variables", "variable_axis_size_partitioner"]
diff --git a/tensorflow/python/ops/rnn_cell.py b/tensorflow/python/ops/rnn_cell.py
index 20af7c88b6..7ef55d8bfc 100644
--- a/tensorflow/python/ops/rnn_cell.py
+++ b/tensorflow/python/ops/rnn_cell.py
@@ -36,7 +36,7 @@ from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.ops.math_ops import sigmoid
from tensorflow.python.ops.math_ops import tanh
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
class RNNCell(object):
diff --git a/tensorflow/python/ops/template.py b/tensorflow/python/ops/template.py
index 78bff9f9db..b2293ad591 100644
--- a/tensorflow/python/ops/template.py
+++ b/tensorflow/python/ops/template.py
@@ -23,7 +23,7 @@ import traceback
from tensorflow.python.framework import ops
from tensorflow.python.ops import variable_scope
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
__all__ = ["make_template"]
diff --git a/tensorflow/python/ops/variable_scope.py b/tensorflow/python/ops/variable_scope.py
index b7bea59028..e929b33aba 100644
--- a/tensorflow/python/ops/variable_scope.py
+++ b/tensorflow/python/ops/variable_scope.py
@@ -32,7 +32,7 @@ from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import variables
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
__all__ = ["VariableScope", "get_variable_scope",
"get_variable", "variable_scope", "variable_op_scope",
diff --git a/tensorflow/python/platform/flags_test.py b/tensorflow/python/platform/flags_test.py
index c057f96993..8830ea265b 100644
--- a/tensorflow/python/platform/flags_test.py
+++ b/tensorflow/python/platform/flags_test.py
@@ -20,9 +20,9 @@ from __future__ import print_function
import sys
-from tensorflow.python.platform.default import _googletest as googletest
+from tensorflow.python.platform import googletest
-from tensorflow.python.platform.default import _flags as flags
+from tensorflow.python.platform import flags
flags.DEFINE_string("string_foo", "default_val", "HelpString")
diff --git a/tensorflow/python/platform/gfile_test.py b/tensorflow/python/platform/gfile_test.py
index 38b8b1d30a..7adccc3a9f 100644
--- a/tensorflow/python/platform/gfile_test.py
+++ b/tensorflow/python/platform/gfile_test.py
@@ -22,9 +22,9 @@ import os
import shutil
import time
-from tensorflow.python.platform.default import _gfile as gfile
-from tensorflow.python.platform.default import _googletest as googletest
-from tensorflow.python.platform.default import _logging as logging
+from tensorflow.python.platform import gfile
+from tensorflow.python.platform import googletest
+from tensorflow.python.platform import tf_logging as logging
class _BaseTest(object):
diff --git a/tensorflow/python/platform/logging.py b/tensorflow/python/platform/logging.py
deleted file mode 100644
index 739552f0de..0000000000
--- a/tensorflow/python/platform/logging.py
+++ /dev/null
@@ -1,208 +0,0 @@
-# Copyright 2015 Google Inc. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ==============================================================================
-
-"""Logging utilities."""
-# pylint: disable=unused-import
-# pylint: disable=g-bad-import-order
-# pylint: disable=invalid-name
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-
-import logging
-import os
-import sys
-import time
-from logging import DEBUG
-from logging import ERROR
-from logging import FATAL
-from logging import INFO
-from logging import WARN
-
-import six
-
-
-# Controls which methods from pyglib.logging are available within the project
-# Do not add methods here without also adding to platform/google/_logging.py
-__all__ = ['log', 'debug', 'error', 'fatal', 'info', 'warn', 'warning',
- 'DEBUG', 'ERROR', 'FATAL', 'INFO', 'WARN',
- 'flush', 'log_every_n', 'log_first_n', 'vlog',
- 'TaskLevelStatusMessage', 'get_verbosity', 'set_verbosity']
-
-# Scope the tensorflow logger to not conflict with users' loggers
-_logger = logging.getLogger('tensorflow')
-_handler = logging.StreamHandler()
-_handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT, None))
-_logger.addHandler(_handler)
-
-log = _logger.log
-debug = _logger.debug
-error = _logger.error
-fatal = _logger.fatal
-info = _logger.info
-warn = _logger.warn
-warning = _logger.warn
-
-_level_names = {
- FATAL: 'FATAL',
- ERROR: 'ERROR',
- WARN: 'WARN',
- INFO: 'INFO',
- DEBUG: 'DEBUG',
-}
-
-# Mask to convert integer thread ids to unsigned quantities for logging
-# purposes
-_THREAD_ID_MASK = 2 * sys.maxsize + 1
-
-_log_prefix = None # later set to google2_log_prefix
-
-# Counter to keep track of number of log entries per token.
-_log_counter_per_token = {}
-
-
-def TaskLevelStatusMessage(msg):
- error(msg)
-
-
-def flush():
- raise NotImplementedError()
-
-
-# Code below is taken from pyglib/logging
-def vlog(level, msg, *args, **kwargs):
- _logger.log(level, msg, *args, **kwargs)
-
-
-def _GetNextLogCountPerToken(token):
- """Wrapper for _log_counter_per_token.
-
- Args:
- token: The token for which to look up the count.
-
- Returns:
- The number of times this function has been called with
- *token* as an argument (starting at 0)
- """
- global _log_counter_per_token # pylint: disable=global-variable-not-assigned
- _log_counter_per_token[token] = 1 + _log_counter_per_token.get(token, -1)
- return _log_counter_per_token[token]
-
-
-def log_every_n(level, msg, n, *args):
- """Log 'msg % args' at level 'level' once per 'n' times.
-
- Logs the 1st call, (N+1)st call, (2N+1)st call, etc.
- Not threadsafe.
-
- Args:
- level: The level at which to log.
- msg: The message to be logged.
- n: The number of times this should be called before it is logged.
- *args: The args to be substituted into the msg.
- """
- count = _GetNextLogCountPerToken(_GetFileAndLine())
- log_if(level, msg, not (count % n), *args)
-
-
-def log_first_n(level, msg, n, *args): # pylint: disable=g-bad-name
- """Log 'msg % args' at level 'level' only first 'n' times.
-
- Not threadsafe.
-
- Args:
- level: The level at which to log.
- msg: The message to be logged.
- n: The number of times this should be called before it is logged.
- *args: The args to be substituted into the msg.
- """
- count = _GetNextLogCountPerToken(_GetFileAndLine())
- log_if(level, msg, count < n, *args)
-
-
-def log_if(level, msg, condition, *args):
- """Log 'msg % args' at level 'level' only if condition is fulfilled."""
- if condition:
- vlog(level, msg, *args)
-
-
-def _GetFileAndLine():
- """Returns (filename, linenumber) for the stack frame."""
- # Use sys._getframe(). This avoids creating a traceback object.
- # pylint: disable=protected-access
- f = sys._getframe()
- # pylint: enable=protected-access
- our_file = f.f_code.co_filename
- f = f.f_back
- while f:
- code = f.f_code
- if code.co_filename != our_file:
- return (code.co_filename, f.f_lineno)
- f = f.f_back
- return ('<unknown>', 0)
-
-
-def google2_log_prefix(level, timestamp=None, file_and_line=None):
- """Assemble a logline prefix using the google2 format."""
- # pylint: disable=global-variable-not-assigned
- global _level_names
- global _logfile_map, _logfile_map_mutex
- # pylint: enable=global-variable-not-assigned
-
- # Record current time
- now = timestamp or time.time()
- now_tuple = time.localtime(now)
- now_microsecond = int(1e6 * (now % 1.0))
-
- (filename, line) = file_and_line or _GetFileAndLine()
- basename = os.path.basename(filename)
-
- # Severity string
- severity = 'I'
- if level in _level_names:
- severity = _level_names[level][0]
-
- s = '%c%02d%02d %02d:%02d:%02d.%06d %5d %s:%d] ' % (
- severity,
- now_tuple[1], # month
- now_tuple[2], # day
- now_tuple[3], # hour
- now_tuple[4], # min
- now_tuple[5], # sec
- now_microsecond,
- _get_thread_id(),
- basename,
- line)
-
- return s
-
-
-def get_verbosity():
- """Return how much logging output will be produced."""
- return _logger.getEffectiveLevel()
-
-
-def set_verbosity(verbosity):
- """Sets the threshold for what messages will be logged."""
- _logger.setLevel(verbosity)
-
-
-def _get_thread_id():
- """Get id of current thread, suitable for logging as an unsigned quantity."""
- thread_id = six.moves._thread.get_ident()
- return thread_id & _THREAD_ID_MASK
-
-
-_log_prefix = google2_log_prefix
diff --git a/tensorflow/python/platform/logging_test.py b/tensorflow/python/platform/logging_test.py
index cc68b16e0d..a581d7197b 100644
--- a/tensorflow/python/platform/logging_test.py
+++ b/tensorflow/python/platform/logging_test.py
@@ -17,8 +17,8 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
-from tensorflow.python.platform.default import _googletest as googletest
-from tensorflow.python.platform.default import _logging as logging
+from tensorflow.python.platform import googletest
+from tensorflow.python.platform import tf_logging as logging
class EventLoaderTest(googletest.TestCase):
diff --git a/tensorflow/python/platform/resource_loader.py b/tensorflow/python/platform/resource_loader.py
index 0188dc6b39..378cdc7663 100644
--- a/tensorflow/python/platform/resource_loader.py
+++ b/tensorflow/python/platform/resource_loader.py
@@ -23,7 +23,7 @@ import inspect
import os.path
import sys
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
def load_resource(path):
diff --git a/tensorflow/python/platform/resource_loader_test.py b/tensorflow/python/platform/resource_loader_test.py
index 28d8ee1d60..a5327ed974 100644
--- a/tensorflow/python/platform/resource_loader_test.py
+++ b/tensorflow/python/platform/resource_loader_test.py
@@ -18,7 +18,7 @@ from __future__ import division
from __future__ import print_function
from tensorflow.python.platform import googletest
-from tensorflow.python.platform.default import _resource_loader as resource_loader
+from tensorflow.python.platform import resource_loader
class DefaultResourceLoaderTest(googletest.TestCase):
diff --git a/tensorflow/python/platform/default/_logging.py b/tensorflow/python/platform/tf_logging.py
index 739552f0de..6d31fb3c91 100644
--- a/tensorflow/python/platform/default/_logging.py
+++ b/tensorflow/python/platform/tf_logging.py
@@ -201,7 +201,9 @@ def set_verbosity(verbosity):
def _get_thread_id():
"""Get id of current thread, suitable for logging as an unsigned quantity."""
+ # pylint: disable=protected-access
thread_id = six.moves._thread.get_ident()
+ # pylint:enable=protected-access
return thread_id & _THREAD_ID_MASK
diff --git a/tensorflow/python/summary/event_accumulator.py b/tensorflow/python/summary/event_accumulator.py
index 1f87d11c40..092fae2bd1 100644
--- a/tensorflow/python/summary/event_accumulator.py
+++ b/tensorflow/python/summary/event_accumulator.py
@@ -24,7 +24,7 @@ import threading
from tensorflow.core.framework import graph_pb2
from tensorflow.core.protobuf.config_pb2 import RunMetadata
from tensorflow.core.util.event_pb2 import SessionLog
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary.impl import directory_watcher
from tensorflow.python.summary.impl import io_wrapper
from tensorflow.python.summary.impl import reservoir
diff --git a/tensorflow/python/summary/event_accumulator_test.py b/tensorflow/python/summary/event_accumulator_test.py
index 8dafaad0db..2715b57c86 100644
--- a/tensorflow/python/summary/event_accumulator_test.py
+++ b/tensorflow/python/summary/event_accumulator_test.py
@@ -26,7 +26,7 @@ from tensorflow.core.framework import graph_pb2
from tensorflow.core.util.event_pb2 import SessionLog
from tensorflow.python.platform import gfile
from tensorflow.python.platform import googletest
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary import event_accumulator as ea
diff --git a/tensorflow/python/summary/event_multiplexer.py b/tensorflow/python/summary/event_multiplexer.py
index 79a7825262..996ae0d420 100644
--- a/tensorflow/python/summary/event_multiplexer.py
+++ b/tensorflow/python/summary/event_multiplexer.py
@@ -23,7 +23,7 @@ import threading
import six
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary import event_accumulator
from tensorflow.python.summary.impl import io_wrapper
diff --git a/tensorflow/python/summary/impl/directory_watcher.py b/tensorflow/python/summary/impl/directory_watcher.py
index e8975517f5..a91b68af08 100644
--- a/tensorflow/python/summary/impl/directory_watcher.py
+++ b/tensorflow/python/summary/impl/directory_watcher.py
@@ -18,7 +18,7 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary.impl import io_wrapper
diff --git a/tensorflow/python/summary/impl/event_file_loader.py b/tensorflow/python/summary/impl/event_file_loader.py
index 150d31edb7..a7d94864f9 100644
--- a/tensorflow/python/summary/impl/event_file_loader.py
+++ b/tensorflow/python/summary/impl/event_file_loader.py
@@ -21,8 +21,8 @@ from __future__ import print_function
from tensorflow.core.util import event_pb2
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.platform import app
-from tensorflow.python.platform import logging
from tensorflow.python.platform import resource_loader
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
diff --git a/tensorflow/python/summary/impl/gcs.py b/tensorflow/python/summary/impl/gcs.py
index 293886255c..b8a9b0223e 100644
--- a/tensorflow/python/summary/impl/gcs.py
+++ b/tensorflow/python/summary/impl/gcs.py
@@ -20,7 +20,7 @@ from __future__ import print_function
import os
import subprocess
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
# All GCS paths should start with this.
PATH_PREFIX = 'gs://'
diff --git a/tensorflow/python/summary/impl/gcs_file_loader.py b/tensorflow/python/summary/impl/gcs_file_loader.py
index 54942cb897..83d61ca94b 100644
--- a/tensorflow/python/summary/impl/gcs_file_loader.py
+++ b/tensorflow/python/summary/impl/gcs_file_loader.py
@@ -22,7 +22,7 @@ import tempfile
from tensorflow.core.util import event_pb2
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.platform import app
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary.impl import gcs
from tensorflow.python.util import compat
diff --git a/tensorflow/python/training/coordinator.py b/tensorflow/python/training/coordinator.py
index 88b827dab3..a4c9880b66 100644
--- a/tensorflow/python/training/coordinator.py
+++ b/tensorflow/python/training/coordinator.py
@@ -25,7 +25,7 @@ import time
import six
from tensorflow.python.framework import errors
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
diff --git a/tensorflow/python/training/device_setter.py b/tensorflow/python/training/device_setter.py
index 1544548a3b..ce11d6a90e 100644
--- a/tensorflow/python/training/device_setter.py
+++ b/tensorflow/python/training/device_setter.py
@@ -19,7 +19,7 @@ from __future__ import print_function
from tensorflow.core.framework import graph_pb2
from tensorflow.python.framework import device as pydev
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import server_lib
diff --git a/tensorflow/python/training/queue_runner.py b/tensorflow/python/training/queue_runner.py
index 0207721a67..a7b2da1fb8 100644
--- a/tensorflow/python/training/queue_runner.py
+++ b/tensorflow/python/training/queue_runner.py
@@ -23,7 +23,7 @@ import threading
from tensorflow.core.protobuf import queue_runner_pb2
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
class QueueRunner(object):
diff --git a/tensorflow/python/training/saver.py b/tensorflow/python/training/saver.py
index 2c29964c84..2c6d29b8c4 100644
--- a/tensorflow/python/training/saver.py
+++ b/tensorflow/python/training/saver.py
@@ -48,7 +48,7 @@ from tensorflow.python.ops import io_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.ops import variables
from tensorflow.python.platform import gfile
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import training_util
from tensorflow.python.training.checkpoint_state_pb2 import CheckpointState
from tensorflow.python.util import compat
diff --git a/tensorflow/python/training/session_manager.py b/tensorflow/python/training/session_manager.py
index 52bdec6ecd..bfb117cddf 100644
--- a/tensorflow/python/training/session_manager.py
+++ b/tensorflow/python/training/session_manager.py
@@ -25,7 +25,7 @@ from tensorflow.python.client import session
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.platform import gfile
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import saver as saver_mod
from tensorflow.python.training import server_lib
diff --git a/tensorflow/python/training/summary_io.py b/tensorflow/python/training/summary_io.py
index a7cf5622d7..c8de9845c7 100644
--- a/tensorflow/python/training/summary_io.py
+++ b/tensorflow/python/training/summary_io.py
@@ -32,7 +32,7 @@ from tensorflow.python import pywrap_tensorflow
from tensorflow.python.framework import ops
from tensorflow.python.lib.io import tf_record
from tensorflow.python.platform import gfile
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import compat
diff --git a/tensorflow/python/training/supervisor.py b/tensorflow/python/training/supervisor.py
index 8bc9c4dcfb..1915aeb08d 100644
--- a/tensorflow/python/training/supervisor.py
+++ b/tensorflow/python/training/supervisor.py
@@ -30,7 +30,7 @@ from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import data_flow_ops
from tensorflow.python.ops import logging_ops
from tensorflow.python.ops import variables
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import coordinator
from tensorflow.python.training import saver as saver_mod
from tensorflow.python.training import session_manager as session_manager_mod
diff --git a/tensorflow/python/training/sync_replicas_optimizer.py b/tensorflow/python/training/sync_replicas_optimizer.py
index 8d46c81272..4bbd47dc65 100644
--- a/tensorflow/python/training/sync_replicas_optimizer.py
+++ b/tensorflow/python/training/sync_replicas_optimizer.py
@@ -26,7 +26,7 @@ from tensorflow.python.ops import data_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.ops import variables
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import optimizer
from tensorflow.python.training import queue_runner
diff --git a/tensorflow/python/training/tensorboard_logging.py b/tensorflow/python/training/tensorboard_logging.py
index 3c2762ce62..99e44e9a7f 100644
--- a/tensorflow/python/training/tensorboard_logging.py
+++ b/tensorflow/python/training/tensorboard_logging.py
@@ -33,7 +33,7 @@ from __future__ import print_function
import time
from tensorflow.core.util import event_pb2
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
DEBUG = 'DEBUG'
INFO = 'INFO'
diff --git a/tensorflow/python/training/tensorboard_logging_test.py b/tensorflow/python/training/tensorboard_logging_test.py
index 26bc25d717..abe02ca52f 100644
--- a/tensorflow/python/training/tensorboard_logging_test.py
+++ b/tensorflow/python/training/tensorboard_logging_test.py
@@ -27,7 +27,7 @@ import time
import tensorflow as tf
from tensorflow.core.util import event_pb2
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import tensorboard_logging
diff --git a/tensorflow/tensorboard/backend/handler.py b/tensorflow/tensorboard/backend/handler.py
index c393c4a170..9f2f780ce8 100644
--- a/tensorflow/tensorboard/backend/handler.py
+++ b/tensorflow/tensorboard/backend/handler.py
@@ -36,8 +36,8 @@ from six.moves import urllib
from six.moves import xrange # pylint: disable=redefined-builtin
from six.moves.urllib import parse as urlparse
-from tensorflow.python.platform import logging
from tensorflow.python.platform import resource_loader
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary import event_accumulator
from tensorflow.python.util import compat
from tensorflow.tensorboard.backend import process_graph
diff --git a/tensorflow/tensorboard/backend/server.py b/tensorflow/tensorboard/backend/server.py
index d0d4b7f144..0b91c628eb 100644
--- a/tensorflow/tensorboard/backend/server.py
+++ b/tensorflow/tensorboard/backend/server.py
@@ -30,7 +30,7 @@ import six
from six.moves import BaseHTTPServer
from six.moves import socketserver
-from tensorflow.python.platform import logging
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary import event_accumulator
from tensorflow.python.summary.impl import gcs
from tensorflow.tensorboard.backend import handler
diff --git a/tensorflow/tensorboard/tensorboard.py b/tensorflow/tensorboard/tensorboard.py
index 78f03f8836..4112c563fc 100644
--- a/tensorflow/tensorboard/tensorboard.py
+++ b/tensorflow/tensorboard/tensorboard.py
@@ -26,9 +26,9 @@ import socket
from tensorflow.python.platform import app
from tensorflow.python.platform import flags
-from tensorflow.python.platform import logging
from tensorflow.python.platform import resource_loader
from tensorflow.python.platform import status_bar
+from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.summary import event_multiplexer
from tensorflow.tensorboard.backend import server