Created
January 17, 2015 04:30
-
-
Save ionrock/497354792ff8b98cf130 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Need to find the IP address so we'll wrap socket.connect to print | |
# the addr info | |
def logging_connect(self, addr, *args, **kw): | |
log('%s:%s', *addr) | |
return socket.socket._original_connect(self, addr, *args, **kw) | |
socket.socket._original_connect = socket.socket.connect | |
socket.socket.connect = logging_connect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment