Parsing multi-line warnings in console output

I am writing a parser for warnings. I have extended the width of LaTeX's output so that errors and warnings all occur on a single line.

However, I have a problem with multi-line, formatted warn warnings as these are more difficult to handle.

An example is the following:

Package biblatex Warning: Biber reported the following issues
(biblatex)                with 'kannan_random_1997':
(biblatex)                - Datamodel: Entry 'kannan_random_1997'
(bibliography.bib): Invalid ISSN in value of field 'issn'.


Here I would like to remove the newline, the (biblatex) and the white-space after it so the warning appears on a single line such as the following:

Package biblatex Warning: Biber reported the following issues with 'kannan_random_1997': - Datamodel: Entry 'kannan_random_1997' Invalid ISSN in value of field 'issn'.


Is there a way of cutting down the output like the above, either by using LaTeX or by changing environment variables/parameters?

MWE:

\documentclass{article}
\begin{document}
\fontfamily{asdf}\selectfont
Hello, world!
\end{document}

• Could you paste a self-contained example document that reproduces the error(s) you want to extract? I presume biblatex errors are not the only ones your want to fetch? – siracusa Oct 19 '18 at 19:53
• probably \def\MessageBreak{} but untested as you provide no test code – David Carlisle Oct 19 '18 at 20:01
• note the latex2e message linebreak specifically puts the package name on each new line so that it's easier to parse these messages and recognise the continuation lines,... – David Carlisle Oct 19 '18 at 20:03
• @DavidCarlisle \def\MessageBreak{} doesn't seem to be working for me... – The Sign Painter Oct 19 '18 at 20:23
• ah no you'd have to patch \GenericWarning where it locally defines \messageBreak – David Carlisle Oct 19 '18 at 20:54

LaTeX Font Warning: Font shape OT1/asdf/m/n' undefined using OT1/cmr/m/n' ins
tead on input line 12.


from

\makeatletter
\DeclareRobustCommand{\GenericWarning}[2]{%
\begingroup
\def\MessageBreak{ }%^^J#1}%
\set@display@protect
\immediate\write\@unused{^^J#2\on@line.^^J}%
\endgroup
}
\makeatother
\documentclass{article}
\begin{document}
\fontfamily{asdf}\selectfont
Hello, world!
\end{document}