|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.ui.framework.java.MessageLog
Provides control over logging and tracing activity within this package.
MessageLog
can be used to redirect error logging to a
specific log file or OutputStream
. It's also used
to suppress the low level information/error messages normally written
to the console.
Method Summary | |
static java.lang.String |
getLogFileName()
Returns the log file name. |
static java.io.OutputStream |
getLogStream()
Returns the log stream. |
static boolean |
isTraceEnabled()
Determines whether low level trace messages will be written to the console. |
static void |
logError(java.lang.Object errorData)
Logs an error string to the current logging destination. |
static void |
logError(java.lang.Object errorData,
java.lang.Throwable throwable)
Logs an error string and a stack trace to the current logging destination. |
static void |
printStackTrace(java.lang.Throwable throwable)
Logs a stack trace to the current logging destination. |
static void |
setLogFileName(java.lang.String fileName)
Sets the log file name. |
static void |
setLogStream(java.io.OutputStream stream)
Sets the log stream. |
static void |
setTraceEnabled(boolean enabled)
Controls whether low level trace messages will be written to the console. |
static void |
traceErr(java.lang.Object data)
Writes data to System.err if low level tracing is enabled. |
static void |
traceOut(java.lang.Object data)
Writes data to System.out if low level tracing is enabled. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void setLogFileName(java.lang.String fileName) throws java.io.IOException
fileName
- the log file name. If null, output goes to System.err
.java.io.IOException
- if the file cannot be accessedgetLogFileName()
public static java.lang.String getLogFileName()
System.err
, or if
an OutputStream
was specified on a call to setLogStream
.setLogFileName(java.lang.String)
,
setLogStream(java.io.OutputStream)
public static void setLogStream(java.io.OutputStream stream)
OutputStream
used by the
application itself for logging errors.stream
- the OutputStream
to which error data should be sent.
If null, output goes to System.err
.getLogStream()
public static java.io.OutputStream getLogStream()
OutputStream
.OutputStream
to which error data is being sentsetLogStream(java.io.OutputStream)
public static void logError(java.lang.Object errorData)
System.err
.errorData
- the data to be loggedpublic static void logError(java.lang.Object errorData, java.lang.Throwable throwable)
System.err
.errorData
- the data to be loggedthrowable
- the Throwable
which will be used to obtain the stack tracepublic static void printStackTrace(java.lang.Throwable throwable)
throwable
- the Throwable
which will be used to obtain the stack tracepublic static void setTraceEnabled(boolean enabled)
true
.enabled
- If true, allows the messages; otherwise, suppresses the messages.isTraceEnabled()
public static boolean isTraceEnabled()
true
.setTraceEnabled(boolean)
public static void traceOut(java.lang.Object data)
System.out
if low level tracing is enabled.data
- the data to be loggedtraceErr(java.lang.Object)
public static void traceErr(java.lang.Object data)
System.err
if low level tracing is enabled.data
- the data to be loggedtraceOut(java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |