コード例 #1
0
  def testVerbosity(self):
    tensorboard_logging.set_summary_writer(self._sw)
    tensorboard_logging.set_verbosity(tensorboard_logging.ERROR)
    tensorboard_logging.warn("warn")
    tensorboard_logging.error("error")
    tensorboard_logging.set_verbosity(tensorboard_logging.DEBUG)
    tensorboard_logging.debug("debug")

    self.assertLoggedMessagesAre([(event_pb2.LogMessage.ERROR, "error"),
                                  (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)
コード例 #2
0
    def testVerbosity(self):
        tensorboard_logging.set_summary_writer(self._sw)
        tensorboard_logging.set_verbosity(tensorboard_logging.ERROR)
        tensorboard_logging.warn("warn")
        tensorboard_logging.error("error")
        tensorboard_logging.set_verbosity(tensorboard_logging.DEBUG)
        tensorboard_logging.debug("debug")

        self.assertLoggedMessagesAre([(event_pb2.LogMessage.ERROR, "error"),
                                      (event_pb2.LogMessage.DEBUG, "debug")])
        # All message should be logged because tensorboard_logging verbosity doesn't
        # affect logging verbosity.
        self.assertEqual(3, self.logged_message_count)
コード例 #3
0
 def testNoSummaryWriter(self):
   """Test that logging without a SummaryWriter succeeds."""
   tensorboard_logging.set_summary_writer(None)
   tensorboard_logging.warn("this should work")
   self.assertEqual(1, self.logged_message_count)