Changed pdflatex to a single log files as it outputs everything to
stdout and improved the error handling so that warnings are printed with
paths to the log file(s) and when in debug mode the contents of the log
file are printed to screen.
Ensured that the log information printed when a latex compile fails is
sent to stderr.