소스 검색

Add a sensible __repr__ to ExceptionInfo for easier debugging

Ask Solem 16 년 전
부모
커밋
197d8880ab
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      celery/datastructures.py

+ 6 - 0
celery/datastructures.py

@@ -73,6 +73,12 @@ class ExceptionInfo(object):
     def __str__(self):
         return str(self.exception)
 
+    def __repr__(self):
+        return "<%s.%s: %s" % (
+                self.__class__.__module__,
+                self.__class__.__name__,
+                str(self.exception))
+
 
 def consume_queue(queue):
     while True: