Package net.sf.saxon.lib
Class Logger
java.lang.Object
net.sf.saxon.lib.Logger
- Direct Known Subclasses:
StandardLogger
,SystemLogger
Interface to diagnostic event logging mechanism.
A Logger can be registered at the level of the Saxon Configuration.
The default implementation for the Java platform writes all messages to System.err
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet a JAXPStreamResult
object allowing serialized XML to be written to the output destination of this Logger.asWriter()
Get aWriter
whose effect is to send each line of written output as a separate INFO message to this Loggervoid
close()
Close the logger, indicating that no further messages will be written and that underlying streams should be closed, if they were created by the Logger itself rather than by the user.void
Log a message with levelDISASTER
void
Log a message with levelERROR
void
Log a message with levelINFO
boolean
Ask whether the Logger is capable of handling the full Unicode character repertoire.abstract void
Log a message.void
setUnicodeAware
(boolean aware) Say whether the Logger is capable of handling the full Unicode character repertoire.void
Log a message with levelWARNING
-
Field Details
-
INFO
public static final int INFO- See Also:
-
WARNING
public static final int WARNING- See Also:
-
ERROR
public static final int ERROR- See Also:
-
DISASTER
public static final int DISASTER- See Also:
-
-
Constructor Details
-
Logger
public Logger()
-
-
Method Details
-
info
Log a message with levelINFO
- Parameters:
message
- the message to be logged
-
warning
Log a message with levelWARNING
- Parameters:
message
- the message to be logged
-
error
Log a message with levelERROR
- Parameters:
message
- the message to be logged
-
disaster
Log a message with levelDISASTER
- Parameters:
message
- the message to be logged
-
println
Log a message. To be implemented in a concrete subclass -
close
public void close()Close the logger, indicating that no further messages will be written and that underlying streams should be closed, if they were created by the Logger itself rather than by the user. -
isUnicodeAware
public boolean isUnicodeAware()Ask whether the Logger is capable of handling the full Unicode character repertoire. By default this is false, because the default destination of console output is sensitive to the configured locale and is often limited to legacy character sets.- Returns:
- true if the Logger can handle the full Unicode character repertoire. With the
default value (false), the
StandardErrorListener
will output special characters using the notation C[xHHHH] where C is the character, and HHHH is its hexadecimal codepoint.
-
setUnicodeAware
public void setUnicodeAware(boolean aware) Say whether the Logger is capable of handling the full Unicode character repertoire. By default this is false, because the default destination of console output is sensitive to the configured locale and is often limited to legacy character sets.- Parameters:
aware
- true if the Logger can handle the full Unicode character repertoire. With the default value (false), theStandardErrorListener
will output special characters using the notation C[xHHHH] where C is the character, and HHHH is its hexadecimal codepoint.
-
asWriter
Get aWriter
whose effect is to send each line of written output as a separate INFO message to this Logger- Returns:
- a suitable
Writer
-
asStreamResult
Get a JAXPStreamResult
object allowing serialized XML to be written to the output destination of this Logger. The default implementation returns aStreamResult
wrapping a customWriter
that writes the supplied text line by line using theprintln(String, int)
method.- Returns:
- a StreamResult that serializes XML to this Logger
-