|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.as400.ui.framework.java.MessageLog
public class MessageLog extends Object
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.
Modifier and Type | Method and Description |
---|---|
static String |
getLogFileName()
Returns the log file name. |
static OutputStream |
getLogStream()
Returns the log stream. |
static boolean |
isTraceEnabled()
Determines whether low level trace messages will be written to the console. |
static void |
logError(Object errorData)
Logs an error string to the current logging destination. |
static void |
logError(Object errorData,
Throwable throwable)
Logs an error string and a stack trace to the current logging destination. |
static void |
printStackTrace(Throwable throwable)
Logs a stack trace to the current logging destination. |
static void |
setLogFileName(String fileName)
Sets the log file name. |
static void |
setLogStream(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(Object data)
Writes data to System.err if low level tracing is enabled. |
static void |
traceOut(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(String fileName) throws IOException
fileName
- the log file name. If null, output goes to System.err
.IOException
- if the file cannot be accessedgetLogFileName()
public static 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(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 OutputStream getLogStream()
OutputStream
.
OutputStream
to which error data is being sentsetLogStream(java.io.OutputStream)
public static void logError(Object errorData)
System.err
.
errorData
- the data to be loggedpublic static void logError(Object errorData, Throwable throwable)
System.err
.
errorData
- the data to be loggedthrowable
- the Throwable
which will be used to obtain the stack tracepublic static void printStackTrace(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(Object data)
System.out
if low level tracing is enabled.
data
- the data to be loggedtraceErr(java.lang.Object)
public static void traceErr(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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |