# Is there a way to suppress all LuaTeX output except errors?

Basically, TeX has a lot to say, and I'm not really interested in most of it. If I were, I'd read the log. The silence package suppresses output, but it suppresses output to the log as well, and further, it only suppresses some of the output, not nearly enough. I don't want hundreds of lines of output to appear every time I run the command, but I still want to be told about errors and be given a prompt.

I know that I can run something like

lualatex myfile.tex 1>/dev/null


or batch-mode to simply suppress all output. But it's useful when LuaTeX tells me about a compiling error, and I would like to keep that while getting rid of everything else.

You can use the reporting callbacks to turn off most messages, for example

\documentclass{article}

\usepackage{array}

\begin{document}

\zzz

\end{document}


produces terminal output of

This is LuaTeX, Version 1.0.4 (TeX Live 2017)
restricted system commands enabled.
(./pp009.tex
LaTeX2e <2017-04-15>
(using write cache: /usr/local/texlive/2017/texmf-var/luatex-cache/generic)(usi
idc/.texlive2017/texmf-var/luatex-cache/generic)
luaotfload | main : initialization completed in 0.652 seconds
Babel <3.10> and hyphenation patterns for 1 language(s) loaded.
(/home/davidc/texmf/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc)))
(/home/davidc/texmf/tex/latex/tools/array.sty) (./pp009.aux)
! Undefined control sequence.
l.7 \zzz

?
(./pp009.aux))
365 words of node memory still in use:
2 hlist, 1 vlist, 1 rule, 2 glue, 4 attribute, 46 glue_spec, 4 attribute_lis
t, 2 write nodes
avail lists: 2:7,3:1,4:1,5:4,7:1,8:1,9:1

warning  (pdf backend): no pages of output.
Transcript written on pp009.log.


but

\directlua{
function be_quiet ()
end
luatexbase.add_to_callback('show_warning_message', be_quiet, 'stop show warning message')
}
\documentclass{article}

\usepackage{array}

\begin{document}

\zzz

\end{document}


Produces terminal output of

This is LuaTeX, Version 1.0.4 (TeX Live 2017)
restricted system commands enabled.
(./pp009.tex
LaTeX2e <2017-04-15>
(using write cache: /usr/local/texlive/2017/texmf-var/luatex-cache/generic)(usi