diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-02-07 15:07:32 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-02-07 15:28:41 -0800 |
commit | 3db4be73d69569bc4a343e6a35adf4c98979f535 (patch) | |
tree | a14fe38fc02db9020d67f30fbee9f6dfc759ea26 | |
parent | 51e34874bc338be4112fb0660edc31e40deaba07 (diff) |
Rename the DEBUG logging level to DEBUGGING.
Some software projects compile C/C++ code with -DDEBUG (equivalent to
-DDEBUG=1) in debug builds. Notably, this is done by default in debug builds on iOS. Therefore, we should avoid using DEBUG as an identifier in C/C++ code.
Change: 146840049
-rw-r--r-- | tensorflow/core/util/event.proto | 6 | ||||
-rw-r--r-- | tensorflow/python/training/tensorboard_logging.py | 2 | ||||
-rw-r--r-- | tensorflow/python/training/tensorboard_logging_test.py | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/tensorflow/core/util/event.proto b/tensorflow/core/util/event.proto index 5c3a88a2d7..5c3799c132 100644 --- a/tensorflow/core/util/event.proto +++ b/tensorflow/core/util/event.proto @@ -43,7 +43,11 @@ message Event { message LogMessage { enum Level { UNKNOWN = 0; - DEBUG = 10; + // Note: The logging level 10 cannot be named DEBUG. Some software + // projects compile their C/C++ code with -DDEBUG in debug builds. So the + // C++ code generated from this file should not have an identifier named + // DEBUG. + DEBUGGING = 10; INFO = 20; WARN = 30; ERROR = 40; diff --git a/tensorflow/python/training/tensorboard_logging.py b/tensorflow/python/training/tensorboard_logging.py index 352e4c308c..b275d2f682 100644 --- a/tensorflow/python/training/tensorboard_logging.py +++ b/tensorflow/python/training/tensorboard_logging.py @@ -56,7 +56,7 @@ _summary_writer = _sentinel_summary_writer # Map from the tensorboard_logging logging enum values to the proto's enum # values. _LEVEL_PROTO_MAP = { - DEBUG: event_pb2.LogMessage.DEBUG, + DEBUG: event_pb2.LogMessage.DEBUGGING, INFO: event_pb2.LogMessage.INFO, WARN: event_pb2.LogMessage.WARN, ERROR: event_pb2.LogMessage.ERROR, diff --git a/tensorflow/python/training/tensorboard_logging_test.py b/tensorflow/python/training/tensorboard_logging_test.py index cc5cefffb4..5af6a0aa7b 100644 --- a/tensorflow/python/training/tensorboard_logging_test.py +++ b/tensorflow/python/training/tensorboard_logging_test.py @@ -94,7 +94,7 @@ class EventLoggingTest(test.TestCase): tensorboard_logging.debug("debug") self.assertLoggedMessagesAre([(event_pb2.LogMessage.ERROR, "error"), - (event_pb2.LogMessage.DEBUG, "debug")]) + (event_pb2.LogMessage.DEBUGGING, "debug")]) # All message should be logged because tensorboard_logging verbosity doesn't # affect logging verbosity. self.assertEqual(3, self.logged_message_count) |