I'm used to log everything I do in my python scripts to the tool-message window with
arcpy.AddMessage("!!!!ERROR!!!!, unable to delete existing folder: " + fpth)
At the end of my script I'd like to grab all messages and write them to a textfile at once.
allmsgs = arcpy.getMessages() #but this only gets the last geoprocessing message
logfile = open("c:\\temp\mytoollog1.txt", 'w')
Maybe it can be grabbed from the results window?