Feature #4637

Support a .debug() or similar method on Logger

Added by Norman Tovey-Walsh over 1 year ago. Updated over 1 year ago.

Start date:
Due date:
% Done:


Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:


It would be nice to use the Saxon Logger interface, rather than dragging in a(nother) logging framework to print diagnostic messages. But there's no method on Logger that's usually below the threshold at which messages are printed. Consider the case of registering extension functions. I don't want to print "Registering extension functions" every time Saxon is run, but I do want to be able to run Saxon with some sort of flag or option that will print messages at that level so that I can trace problems other users are having.

In particular, I'm looking at adding a message for the case where an extension function would have been registered, but it's detected that some third party library isn't available on the classpath. On the one hand, that's a useful message if you're trying to figure out why ext:foo() isn't available. On the other hand, if you don't care about ext:foo() and have no intention of putting the required library on your classpath, seeing that debug message everytime is going to become irritating.


#1 Updated by Michael Kay over 1 year ago

I think this is what was intended for; but we aren't really using the mechanism properly: we have almost no code that changes the logging threshold, and we have other mechanisms in parallel, e.g. the -t flag doesn't change the logging threshold, it sets a flag in Configuration that's checked independently; similarly for -TJ which is in the kind area you're talking about.

There should probably also be a system of message categories that's orthogonal to level.

#2 Updated by Norman Tovey-Walsh over 1 year ago


I decided in the short term to just create a simple wrapper around Logger that has a debug () method and decides whether or not to send those messages to based on a system property. It's a little crude, but it'll get the job done.

#3 Updated by Norm Tovey-Walsh over 1 year ago

  • Assignee set to Norm Tovey-Walsh

Please register to edit this issue

Also available in: Atom PDF