Project

Profile

Help

Feature #3741

closed

Allow users to configure message logs

Added by Debbie Lockett almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Low
Category:
-
Sprint/Milestone:
-
Start date:
2018-04-11
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Arising in Feature #3569: it would be good to provide a way to allow users to disable warning messages, e.g. from ixsl:set-property.

We should also think generally about allowing users to configure the message logs from Saxon-JS (i.e. console logs in the browser). Saxon-CE provided a debug version, which could be configured to run various logging levels - e.g. off, and full tracing.

Actions #1

Updated by Debbie Lockett almost 6 years ago

Saxon-JS produces log messages when saxonPrint is called. Currently these can be grouped as:

A. Loading log (i.e. "Saxon-JS 1.x in browser")

B. Transform initialization logs (i.e. "Transform options supplied:...", "SEF generated by Saxon-EE version..."

C. Warning logs (e.g. from ixsl:set-property, and xsl:result-document)

D. Processing logs* (e.g. messages about HTTP processing, adding to docPool local cache, loading categories.json)

  • I always have been unsure whether these should be included or not. I've found them useful in development, but it's hard to tell whether these are useful or unwanted by other users. Also I think sometimes we've just left our internal debugging messages in by mistake.

Internally in Saxon-JS we have an evaluateWithTracing version of the evaluate function, which can be used during development (it produces XML output as the SEF is processed). It may be useful to allow users to switch on this tracing, as an additional "high level" of logging.

So I propose using the following logging levels:

-1 Loading log only

0 Transform initialization logs

1 [Default] Warning logs

2 Processing logs

...

10 Full tracing

Setting the logLevel to x allows logs from level x and lower only. So setting the level to 0 switches off warnings; setting the level to 2 or higher adds some processing messages; and setting to 10 provides full tracing.

Potentially, we may want to add further levels of processing messages, between 2 and 10 (hence leaving a gap). Though you'd probably want to add processing messages for different areas, and these might not fit so well on a numeric scale... Note that Saxon-CE used named levels e.g. OFF, SEVERE, WARNING, FINE, FINER, FINEST. I think the numbers currently make some sense, but would welcome feedback (and as noted, might not be so easily extendable).

To set the logLevel, we could introduce a SaxonJS method SaxonJS.setLogLevel, and/or a SaxonJS.transform option. Note that both mechanisms were available with Saxon-CE (using the Saxon.setLogLevel function and Command.logLevel property, respectively). So I'm inclined to add both for Saxon-JS too. Note that level -1 can only be set with SaxonJS.setLogLevel (it is too late with a SaxonJS.transform option.)

Actions #2

Updated by Debbie Lockett almost 6 years ago

In the types of Saxon-JS logs, I've missed the log output from the fn:trace() function. I think these belong to group C. Warning logs, i.e. level 1 (so that they are included by default).

Actions #3

Updated by Debbie Lockett almost 6 years ago

Code changes committed on 1.x and 2.0 branches; as described above.

Actions #4

Updated by Debbie Lockett almost 6 years ago

Todo: documentation.

Actions #5

Updated by Debbie Lockett almost 6 years ago

  • Status changed from New to In Progress

Documentation updates committed (but still hoping for some feedback on the design!)

Actions #6

Updated by Debbie Lockett almost 6 years ago

  • Status changed from In Progress to Resolved
  • Fix Committed on JS Branch 1.0, Trunk added

It's been agreed that the design looks OK: the scale is a little odd, but there are reasons behind the choice!

"logLevel" JS unit tests committed (setting logLevel using SaxonJS.setLogLevel() and logLevel transform option).

Actions #7

Updated by Debbie Lockett almost 6 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 1.1.0

Bug fix applied in the Saxon-JS 1.1.0 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page