from Patrick Gundlach |

New logging backend

Categories: Development, speedata Publisher

The version 4.17.1 introduces a completely new logging backend. The idea is to have a short summary of the speedata Publishing run (name of the PDF file, error and warning count and version number) and a more detailed protocol file.

When you run the speedata Publisher on a “hello, world” layout, you will get output like this:

Run speedata publisher 4.17.1 (Pro)
Finished with 0 errors and 0 warnings
Output written on publisher.pdf (1 pages, 3071 bytes)
Transcript written to publisher-protocol.xml
Total run time: 65.976541ms

The publisher-protocol.xml file (which replaces the old publisher.protocol) contains more information, depending on the log level. Normally (without warnings or errors) this file is more or less empty:

<log loglevel="WARN" time="Jan 10 13:34:27" version="4.17.0" pro="yes">
</log>

You can see from the loglevel attribute that this log file contains only warnings and errors. If you set the log level to info, you get more output:

sp --loglevel info

gives this

<log loglevel="INFO" time="Jan 10 13:38:39" version="4.17.0" pro="yes">
  <entry level="INFO" msg="Start processing"></entry>
  <entry level="INFO" msg="Running LuaTeX version 1.15.0 on macosx"></entry>
  <entry level="INFO" msg="Define font family" name="text" size="10.0" leading="12.0" id="1"></entry>
  <entry level="INFO" msg="speedata Publisher Pro"></entry>
  <entry level="INFO" msg="Load XML" type="layout instructions" filename="layout.xml"></entry>
  <entry level="INFO" msg="Load XML" type="aux file" filename="publisher-aux.xml"></entry>
  <entry level="INFO" msg="Load XML" type="data file" filename="data.xml"></entry>
  <entry level="INFO" msg="Create page" type="Default Page" pagenumber="1"></entry>
  <entry level="INFO" msg="Number of rows: 28, number of columns = 19"></entry>
  <entry level="INFO" msg="Create font metrics" name="texgyreheros-regular.otf" size="10.0" id="1" mode="fontforge"></entry>
  <entry level="INFO" msg="Shipout page 1"></entry>
  <entry level="INFO" msg="Stop processing data"></entry>
  <entry level="INFO" msg="0 errors occurred"></entry>
  <entry level="INFO" msg="Duration: 0.029637 seconds"></entry>
</log>

Setting the log level to debug gives even more information, probably too much for the regular publishing run.

If you want to get the logging output in a more human friendly way to the standard out, you can run the speedata Publisher with the --verbose flag (this is with log level “info”):

Config files read:  /home/user/.publisher.cfg, /home/user/speedata/publisher.cfg
Run speedata publisher 4.17.1 (Pro)
Start processing
Running LuaTeX version 1.15.0 on macosx
Define font family (name=text,size=10.0,leading=12.0,id=1)
speedata Publisher Pro
Load XML (type=layout instructions,filename=layout.xml)
Load XML (type=aux file,filename=publisher-aux.xml)
Load XML (type=data file,filename=data.xml)
Create page (type=Default Page,pagenumber=1)
Number of rows: 28, number of columns = 19
Create font metrics (name=texgyreheros-regular.otf,size=10.0,id=1,mode=fontforge)
Shipout page 1
Stop processing data
0 errors occurred
Duration: 0.025352 seconds
Finished with 0 errors and 0 warnings
Output written on publisher.pdf (1 pages, 3071 bytes)
Transcript written to publisher-protocol.xml
Total run time: 76.818958ms