Skip to content

Commit ad67415

Browse files
tensorflower-gardenergunan
authored andcommitted
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
1 parent c6d6468 commit ad67415

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

tensorflow/core/util/event.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ message Event {
4343
message LogMessage {
4444
enum Level {
4545
UNKNOWN = 0;
46-
DEBUG = 10;
46+
// Note: The logging level 10 cannot be named DEBUG. Some software
47+
// projects compile their C/C++ code with -DDEBUG in debug builds. So the
48+
// C++ code generated from this file should not have an identifier named
49+
// DEBUG.
50+
DEBUGGING = 10;
4751
INFO = 20;
4852
WARN = 30;
4953
ERROR = 40;

tensorflow/python/training/tensorboard_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# Map from the tensorboard_logging logging enum values to the proto's enum
5757
# values.
5858
_LEVEL_PROTO_MAP = {
59-
DEBUG: event_pb2.LogMessage.DEBUG,
59+
DEBUG: event_pb2.LogMessage.DEBUGGING,
6060
INFO: event_pb2.LogMessage.INFO,
6161
WARN: event_pb2.LogMessage.WARN,
6262
ERROR: event_pb2.LogMessage.ERROR,

tensorflow/python/training/tensorboard_logging_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def testVerbosity(self):
9494
tensorboard_logging.debug("debug")
9595

9696
self.assertLoggedMessagesAre([(event_pb2.LogMessage.ERROR, "error"),
97-
(event_pb2.LogMessage.DEBUG, "debug")])
97+
(event_pb2.LogMessage.DEBUGGING, "debug")])
9898
# All message should be logged because tensorboard_logging verbosity doesn't
9999
# affect logging verbosity.
100100
self.assertEqual(3, self.logged_message_count)

0 commit comments

Comments
 (0)