-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log information from Lua Filters #9662
Comments
If the output of |
My thought process when I suggested to open this issue was that local orig_io_write = io.write
io.write = function (...)
pandoc.report('This is an info', 'INFO')
return orig_io_write(...)
end I.e., allow users to redefine I believe that giving users more access to the logging system would generally be a good idea. But it's difficult to make it useful without just tying it to the internals, as those should probably remain hidden. A suitable API design might be achievable, but I don't have one yet. |
When they use |
I understand @jgm's concern about not making pandoc too complex. But as @tarleb points out, I think it would be useful to have messages at the 'info' level (which is why I use I want to clarify a few points regarding the behaviour of Thank you very much for the comments, they really help me also to clarify what is the behaviour I am asking for. |
Yes, pandoc generates a ScriptingWarning message, which was introduced specifically for that purpose. The relevant PR was #8685. |
The expectation is that users will use |
The following might be a reasonable design: New module pandoc.lua with three functions:
It would be enough to resolve this issues as well as #9077. |
I've creates #9668 for experimentation and as a proof of concept. |
It would be interesting if the log file (
--log=file
) could store the output of the lua filters generated by theerror
andio.write
functions. Currently it only saves the output ofwarn
. In the related discussion, @jgm and @tarleb suggested "provide areport
function" to address the problem.Thanks in advance for the work.
Discussed in #9659
Originally posted by estedeahora April 14, 2024
I am using pandoc with a set of custom lua filters. In the call to pandoc I use '--log=file.log', but I am interested in this log file incorporating information arising from the lua filters. In the lua filter I display this information in the console via io.write or error.
Is there any way to incorporate this directly into the 'file.log'?
Thanks!
The text was updated successfully, but these errors were encountered: