Why don't you take a look at the UDF Forum, e.g. Err() or DisplayText()? However, this is something you have to design into your script, you can't just say, hey, log all return codes whereever/whenever into a file.
_________________________
There are two types of vessels, submarines and targets.