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

Add __repr__ to monitoring event classes

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.11
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      It would be nice to add human readable __repr__ to our monitoring event classes. This change would make it much easier to debug tests since we could immediately see a readable description instead of:

      <pymongo.monitoring.ServerDescriptionChangedEvent object at 0x104f2d300>
      

      Something like:

      <pymongo.monitoring.ServerDescriptionChangedEvent localhost:27017 changed type from RSPrimary to Unknown>
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: