Use exc_info for logging tracebacks
This commit is contained in:
		@@ -4,7 +4,6 @@ import logging
 | 
				
			|||||||
import sys
 | 
					import sys
 | 
				
			||||||
from threading import Event, RLock
 | 
					from threading import Event, RLock
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import traceback
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if 'gevent.monkey' in sys.modules:
 | 
					if 'gevent.monkey' in sys.modules:
 | 
				
			||||||
    from gevent.queue import Queue, Empty
 | 
					    from gevent.queue import Queue, Empty
 | 
				
			||||||
@@ -164,12 +163,8 @@ class Connection(object):
 | 
				
			|||||||
                return
 | 
					                return
 | 
				
			||||||
            self.is_defunct = True
 | 
					            self.is_defunct = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        trace = traceback.format_exc(exc)
 | 
					        log.debug("Defuncting connection (%s) to %s:",
 | 
				
			||||||
        if trace != "None":
 | 
					                  id(self), self.host, exc_info=exc)
 | 
				
			||||||
            log.debug("Defuncting connection (%s) to %s: %s\n%s",
 | 
					 | 
				
			||||||
                      id(self), self.host, exc, traceback.format_exc(exc))
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            log.debug("Defuncting connection (%s) to %s: %s", id(self), self.host, exc)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.last_error = exc
 | 
					        self.last_error = exc
 | 
				
			||||||
        self.close()
 | 
					        self.close()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user