AnsweredAssumed Answered

Is there a way to grab the all text from the tool execution dialog at the end of a python tool? I want to write the content to a log (10.1).

Question asked by tekenbeet on Aug 24, 2016
Latest reply on Aug 24, 2016 by tekenbeet

I'm used to log everything I do in my python scripts to the tool-message window with

like this..

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.

 

something like:

allmsgs = arcpy.getMessages()  #but this only gets the last geoprocessing message
logfile = open("c:\\temp\mytoollog1.txt", 'w')
logfile.write(allmsgs)
logfile.close

 

Maybe it can be grabbed from the results window? 

 

Thanks

Outcomes