code: def test_default_logging(self, records):
      def fn(a):
          if a.sum() < 0:
              a = torch.sin(a)
          else:
              a = torch.cos(a)
          print("hello")
          return a + 1
  
      fn_opt = torch._dynamo.optimize("eager")(fn)
      fn_opt(torch.ones(10, 10))
      fn_opt(-torch.ones(10, 5))
  
      self.assertGreater(
          len([r for r in records if ".__graph_breaks" in r.name]), 0
      )
      self.assertGreater(
          len([r for r in records if ".__recompiles" in r.name]), 0
      )
      self.assertGreater(
          len([r for r in records if ".symbolic_shapes" in r.name]), 0
      )
      self.assertGreater(
          len([r for r in records if ".__guards" in r.name]), 0
      )
      self.assertGreater(
          len([r for r in records if "return a + 1" in r.getMessage()]),
          0,
      )
  
imports: import atexit
  import contextlib
  import functools
  import logging
  import os
  import re
  import unittest.mock
  import torch
  import torch._dynamo.test_case
  import torch._dynamo.testing
  import torch.distributed
  from torch._dynamo.testing import skipIfNotPy311
  from torch.nn.parallel import DistributedDataParallel
  from torch.testing._internal.common_utils import find_free_port, munge_exc
  from torch.testing._internal.inductor_utils import HAS_CUDA
  from torch.testing._internal.logging_utils import LoggingTestCase, make_logging_test, make_settings_test
label_desc: Use image node_id 28 for calling the LoggingTests obj's underlying member method code with example usage: obj.test_default_logging(records) and returns: unknown