Skip to content
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

Proper logging #19

Open
7 tasks
bertfrees opened this issue Mar 24, 2015 · 5 comments
Open
7 tasks

Proper logging #19

bertfrees opened this issue Mar 24, 2015 · 5 comments
Assignees

Comments

@bertfrees
Copy link
Member

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

  • INFO about which sub-transformers are being selected
  • DEBUG about creation of transformers
  • DEBUG about providers that can not provide a match for a query
  • do logging not only in Java but also in XProc and XSLT
  • do logging to both user interface (event bus) and log file (SLF4J)
  • use correct levels so that the right messages show up in the user interface (conventions in developer documentation)
  • control how many times something is logged (related to caching Get caching right #21)
@josteinaj
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

bertfrees commented Mar 25, 2015

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

@bertfrees
Copy link
Member Author

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.

@bertfrees bertfrees self-assigned this Mar 27, 2015
bertfrees added a commit that referenced this issue Jun 16, 2015
The main purpose is to be able to create job messages from Java.

JobContext currently implements the SLF4J Logger interface. Messages
sent to this logger should be forwarded to the framework's message event
bus.

The idea is that eventually we'll get JobContext objects from the
framework, but for the time being I construct my own JobContext that
uses a hack with Calabash's XProcMessageListener.

See issue #19
bertfrees added a commit that referenced this issue Jun 19, 2015
The main purpose is to be able to create job messages from Java.

JobContext currently implements the SLF4J Logger interface. Messages
sent to this logger should be forwarded to the framework's message event
bus.

The idea is that eventually we'll get JobContext objects from the
framework, but for the time being I construct my own JobContext that
uses a hack with Calabash's XProcMessageListener.

See issue #19
bertfrees added a commit that referenced this issue Jun 19, 2015
see issue #19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants