Package net.sf.saxon.lib
Class StandardLogger
- java.lang.Object
- 
- net.sf.saxon.lib.Logger
- 
- net.sf.saxon.lib.StandardLogger
 
 
- 
 public class StandardLogger extends Logger The default Logger used by Saxon on the Java platform. All messages are written by default to System.err. The logger can be configured by setting a different output destination, and by setting a minimum threshold for the severity of messages to be output.
- 
- 
Constructor SummaryConstructors Constructor Description StandardLogger()Create a Logger that wraps the System.err output streamStandardLogger(java.io.File fileName)Create a Logger that writes to a specified fileStandardLogger(java.io.PrintStream stream)Create a Logger that wraps the specified stream.StandardLogger(java.io.Writer writer)Create a Logger that wraps the specified writer.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.xml.transform.stream.StreamResultasStreamResult()Get a JAXP Result object allowing serialized XML to be written to the output destination of this Loggervoidclose()Close the logger, indicating that no further messages will be writtenjava.io.PrintWritergetPrintWriter()Get the output destination used for messagesintgetThreshold()Get the minimum threshold for the severity of messages to be output.voidprintln(java.lang.String message, int severity)Output a message with a specified severity.voidsetPrintStream(java.io.PrintStream stream)Set the output destination for messagesvoidsetPrintWriter(java.io.PrintWriter writer)Set the output destination for messagesvoidsetThreshold(int threshold)Set the minimum threshold for the severity of messages to be output.- 
Methods inherited from class net.sf.saxon.lib.LoggerasWriter, disaster, error, info, isUnicodeAware, setUnicodeAware, warning
 
- 
 
- 
- 
- 
Constructor Detail- 
StandardLoggerpublic StandardLogger() Create a Logger that wraps the System.err output stream
 - 
StandardLoggerpublic StandardLogger(java.io.PrintStream stream) Create a Logger that wraps the specified stream. Closing the Logger will not close the underlying stream; this remains the caller's responsibility- Parameters:
- stream- the stream to which the Logger's output should be written
 
 - 
StandardLoggerpublic StandardLogger(java.io.Writer writer) Create a Logger that wraps the specified writer. Closing the Logger will not close the underlying stream; this remains the caller's responsibility- Parameters:
- writer- the writer to which the Logger's output should be written
 
 - 
StandardLoggerpublic StandardLogger(java.io.File fileName) throws java.io.FileNotFoundExceptionCreate a Logger that writes to a specified file- Parameters:
- fileName- the file to which output should be written. When the logger is closed, output will be flushed to the file.
- Throws:
- java.io.FileNotFoundException- if the file is not accessible
 
 
- 
 - 
Method Detail- 
setPrintStreampublic void setPrintStream(java.io.PrintStream stream) Set the output destination for messages- Parameters:
- stream- the stream to which messages will be written. Defaults to System.err. The caller is responsible for closing the stream after use (it will not be closed by the close() method on the Logger)
 
 - 
setPrintWriterpublic void setPrintWriter(java.io.PrintWriter writer) Set the output destination for messages- Parameters:
- writer- the stream to which messages will be written. Defaults to System.err. The caller is responsible for closing the stream after use (it will not be closed by the close() method on the Logger)
 
 - 
getPrintWriterpublic java.io.PrintWriter getPrintWriter() Get the output destination used for messages- Returns:
- the stream to which messages are written
 
 - 
setThresholdpublic void setThreshold(int threshold) Set the minimum threshold for the severity of messages to be output. Defaults toLogger.INFO. Messages whose severity is below this threshold will be ignored- Parameters:
- threshold- the minimum severity of messages to be output.
 
 - 
getThresholdpublic int getThreshold() Get the minimum threshold for the severity of messages to be output. Defaults toLogger.INFO. Messages whose severity is below this threshold will be ignored- Returns:
- the minimum severity of messages to be output.
 
 - 
asStreamResultpublic javax.xml.transform.stream.StreamResult asStreamResult() Get a JAXP Result object allowing serialized XML to be written to the output destination of this Logger- Overrides:
- asStreamResultin class- Logger
- Returns:
- a Result that serializes XML to this Logger
 
 - 
printlnpublic void println(java.lang.String message, int severity)Output a message with a specified severity.- Specified by:
- printlnin class- Logger
- Parameters:
- message- The message to be output
- severity- The severity: one of- Logger.INFO,- Logger.WARNING,- Logger.ERROR,- Logger.DISASTER
 
 
- 
 
-