daisy / pipeline-mod-braille

!! NOTE: This project is now part of the pipeline-modules project !! | Braille Production Modules for the DAISY Pipeline 2
1 stars 3 forks source link

Proper logging #19

Open bertfrees opened 9 years ago

bertfrees commented 9 years ago

in order to improve user experience and to make debugging easier.

josteinaj commented 9 years ago

Do you know a way to set logging level for messages in XSLT?

Also, I've found that naming as many XProc steps as possible (with the name attribute, even though they're not referred to) gives logs that are easier to read.

bertfrees commented 9 years ago

Setting logging level for xsl:message, don't think Calabash provides something like that. We should probably make our own pf:message template/function for that.

Another thing is that AFAIK messages in XProc/XSLT are always send to event bus, and messages in Java are always send directly to SLF4J logger. There could be the need for sending to event bus from Java (and maybe for sending directly to SLF4J from XProc/XSLT although that's less likely).

bertfrees commented 9 years ago

Calabash always makes xsl:message into INFO: see XSLT.java#L356

bertfrees commented 9 years ago

In order to log messages per job, from Java, some non-trivial changes are needed. In XProc/XSLT it is always known where messages have to go (what the current job is), because each job has its own Calabash runtime and each runtime has its own message listener. In Java however we don't know what the current job is. In order to know, objects that produce messages either have to be recreated for each new job, or their methods have to have a job object argument. The former sounds more feasible.

In practice, this would mean that instead of connecting (with OSGi) TransformProvider objects, we would be connecting PerJob objects, where PerJob is an extra indirection for getting the instance belonging to the current job.

josteinaj commented 8 years ago

Related issues: