Project

Profile

Help

Feature #4637

Support a .debug() or similar method on Logger

Added by Norman Tovey-Walsh about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2020-07-09
Due date:
% Done:

0%

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

Description

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.

History

#1 Updated by Michael Kay about 1 month ago

I think this is what Logger.info() 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 about 1 month ago

+1

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 logger.info() based on a system property. It's a little crude, but it'll get the job done.

Please register to edit this issue

Also available in: Atom PDF