Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-5264

Investigate enabling specific logs for tests

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: greenerbuild
    • None
    • None
    • Python Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      In theory, we should be seeing DEBUG logs for ocsp tests, based on the config in test_ocsp.py. However, we only see the logs when DEBUG_LOG is set. We should be able to see just the logs for a given component without needing to set DEBUG_LOG.

      # Enable logs in this format:
      # 2020-06-08 23:49:35,982 DEBUG ocsp_support Peer did not staple an OCSP response
      FORMAT = "%(asctime)s %(levelname)s %(module)s %(message)s"
      logging.basicConfig(format=FORMAT, level=logging.DEBUG)
      

      Definition of done

      Modules with pytest markers have scoped logging set up appropriately.

      Pitfalls

      Make sure we're not enabling all logs by default, and that we don't mess up the behavior of DEBUG_LOG.

            Assignee:
            Unassigned Unassigned
            Reporter:
            steve.silvester@mongodb.com Steve Silvester
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: