public class ConsoleTraceImpl
extends java.lang.Object
com.novell.nds.dirxml.driver.TraceInterface
that
can be registered with the com.novell.nds.dirxml.driver.Trace
class.
Trace messages are output to System.out.Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_TIME_FORMAT
Default timestamp formatting string to use: "[MM/dd/yy HH:mm:ss.SS]: "
|
protected static LocalizedMessageSource |
messageSource
Source of localized message strings
|
protected static java.io.PrintStream |
printStream
PrintStream to which output is written |
protected static java.lang.String |
TAB
String used for indenting XML documents
|
protected static java.text.SimpleDateFormat |
timeFormat
Time formatter for timestamps.
|
protected static java.lang.String |
timeFormatString
Time format string for timestamps.
|
protected static java.lang.String |
TRACE_TIMEFORMAT |
protected static int |
traceLevel |
Constructor and Description |
---|
ConsoleTraceImpl()
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getLevel()
Return the current trace level.
|
static void |
setLevel(int newLevel)
Set the trace level for this class.
|
protected static java.lang.String |
timeStampMessage(java.lang.String message)
Prepend a timestamp to a String and return the result.
|
void |
trace(int color,
int level,
java.lang.String message)
Output a message string if the passed level is
greater than or equal to the current trace level.
|
void |
trace(int level,
java.lang.String message)
Output a message string if the passed level is
greater than or equal to the current trace level.
|
void |
trace(int level,
XmlDocument document)
Serialize and output XML document if passed level
is greater than or equal to the current trace level.
|
protected void |
traceAlways(org.w3c.dom.Document document)
Output an XML
Document regardless of level |
protected void |
traceAlways(java.lang.String message)
Output a message regardless of level.
|
protected static int traceLevel
protected static final java.lang.String TAB
protected static LocalizedMessageSource messageSource
protected static java.io.PrintStream printStream
PrintStream
to which output is writtenprotected static java.lang.String timeFormatString
protected static java.text.SimpleDateFormat timeFormat
protected static final java.lang.String DEFAULT_TIME_FORMAT
protected static final java.lang.String TRACE_TIMEFORMAT
public ConsoleTraceImpl()
com.novell.nds.dirxml.driver.Trace
class.public int getLevel()
public static void setLevel(int newLevel)
newLevel
- new trace levelpublic void trace(int level, java.lang.String message)
trace
in interface TraceInterface
level
- trace level for message.message
- String
to output.public void trace(int color, int level, java.lang.String message)
trace
in interface TraceInterface
color
- Ignored herelevel
- trace level for message.message
- String
to output.public void trace(int level, XmlDocument document)
trace
in interface TraceInterface
level
- trace level for document.document
- The XML document to outputprotected void traceAlways(java.lang.String message)
message
- String
to outputprotected void traceAlways(org.w3c.dom.Document document)
Document
regardless of leveldocument
- XML Document
protected static java.lang.String timeStampMessage(java.lang.String message)
message
- String to which to prepend timestamp.