Allow logging extended information from the backends.

In particular this is useful to record the entire LaTeX log and error
output from the latex backend.

Change-Id: Icafbc480be9173b33f1168d1d8adbfc1a3433c91