understanding if LaTeX run is successful

I'm using LaTeX in batch scripts, and I need to detect if the result is successful. It seems the best way is to look into the log file. I wonder if an imaginery tool "texloginfo" exists to:

"texloginfo --rerun": detect if re-run of LaTeX is required (for example, to get cross-references right).
"texloginfo --warnings": extract warning messages from the log file.
"texloginfo --errors": extract warning messages from the log file.

I suspect such a program doesn't exist, and I have to write it. Then, if you are interested in the tool, please send me comments and suggestions.

Categories: TeX

Updated: