class_docstr: Tests for `log_latency`.
class_docstr_tok: ["Tests","for","`","log_latency","`","."]
code: def assert_logs_matching(self, needle):
      with self.assertLogs() as cm:
          yield
      if not any(needle in line for line in cm.output):
          self.fail(
              "Expected a log line containing %r, but got:\n%s"
              % (needle, "\n".join(cm.output))
          )
  
file_path: tensorboard/tensorboard/util/timing_test.py
imports: import contextlib
  from tensorboard import test
  from tensorboard.util import tb_logging
  from tensorboard.util import timing
label_desc: Use image node_id 1 for calling the LogLatencyTest obj's underlying member method code with example usage: obj.assert_logs_matching(needle) without return types