| 101 | |
| 102 | |
| 103 | class LogEntry: |
| 104 | def __init__(self, msg, level): |
| 105 | # it's important that we serialize to string here already so that we don't pick up changes |
| 106 | # happening after this log statement. |
| 107 | self.msg = str(msg) |
| 108 | self.level = level |
| 109 | |
| 110 | def __eq__(self, other): |
| 111 | if isinstance(other, LogEntry): |
| 112 | return self.__dict__ == other.__dict__ |
| 113 | return False |
| 114 | |
| 115 | def __repr__(self): |
| 116 | return f"LogEntry({self.msg}, {self.level})" |
| 117 | |
| 118 | |
| 119 | class Log: |