UPDATE: In hindsight, I realize that this question is really, "Is there any way for LaTeX to keep the file context and warning/error message on the same line?"
This would be fore the purpose of automated parsing of a log file using regular expressions (e.g. looking for a key word like "Invalid" and having the file context be in the result, not just the one line containing the message).
egreg answered this with a definitive NO, it is hardcoded in XeTeX. :(
In an e-mail to the maintainer of
anyfontsize P. Szabó:
I'm not actively maintaining this package anymore. Feel free to convert it to UTF-8, and upload the new version of CTAN. You have my approval.
Original question text
I am typesetting documents with XeLaTeX. I have the bold aspiration to remove all warnings and errors from my document builds :D (nearly impossible, but nothing I cannot strive for!)
One of the warnings I and a colleague finally tracked down to
anyfontsize, which is an official package in TeX Live. All packages are either in UTF-8 or ASCII, except this one (ISO-8859), because the creator has diacritics in his name (likely Hungarian ;) ) I e-mailed him about this already. Anyway, my real concern is the following message:
grep -Pin 'Invalid' myfile.log
Invalid UTF-8 byte or sequence at line 3 replaced by U+FFFD.
This message is useless without a context (yes, line 3 is a context, but hardly useful as you can see). I propose adding context to these messages by adding the file name. This way, I could immediately know that this error was cause during the reading of
anyfontsize. Maybe something like "show last file loaded" before every error/warning.
Is this already possible? I know about
\listfiles, which is great!
I can try to suppress messages that are not a problem by using the
silence package. However, it is not a good idea to do this, because the message is not unique enough without a context (line 3 of what?).