|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.SystemLog
public class SystemLog
SystemLog provides a consistent way for applications and applets to report and/or record errors, warnings, and notable conditions that occur.
By default, the errorLog, warningLog, and noteLog use the same SystemLog. You can change this by setting the appropriate field on the SysteLog class.
Field Summary | |
---|---|
static SystemLog |
errorLog
|
protected boolean |
logStackTraces
|
static SystemLog |
noteLog
|
protected java.io.PrintWriter |
stream
|
protected java.text.DateFormat |
timestamp
|
protected boolean |
timestampUsed
|
static SystemLog |
warningLog
|
Constructor Summary | |
---|---|
SystemLog()
Default constructor. |
|
SystemLog(java.io.PrintWriter stream)
Constructor that takes a stream to write to. |
Method Summary | |
---|---|
void |
clear()
Clears the log. |
boolean |
getLogStackTraces()
Returns whether stack traces are appended to log when printToLog() is called. |
java.io.PrintWriter |
getPrintWriter()
Returns the stream to append messages to. |
java.text.DateFormat |
getTimestamp()
Returns the time stamp format used when appending the time to the log. |
void |
handleError(com.sas.ComponentInterface component,
com.sas.text.Message message,
java.lang.String messageCode)
Print the specified error to the error log. |
boolean |
isTimestampUsed()
Returns whether times stamps are appended to log when printToLog() is called. |
static void |
logError(java.lang.String msg)
|
static void |
logException(java.lang.String msg,
java.lang.Throwable throwable)
|
static void |
logNote(java.lang.String msg)
|
static void |
logWarning(java.lang.String msg)
|
void |
printStackTrace()
Prints a stack trace to the log. |
void |
printToLog(java.lang.String type,
java.lang.String msg)
Print the specified message to the log. |
void |
setLogStackTraces(boolean logStackTraces)
Sets whether stack traces are appended to log when printToLog() is called. |
void |
setPrintWriter(java.io.PrintWriter stream)
Sets the stream to append messages to. |
void |
setTimestamp(java.text.DateFormat timestamp)
Sets the time stamp format used when appending the time to the log. |
void |
setTimestampUsed(boolean timestampUsed)
Sets whether time stamps are appended to log when printToLog() is called. |
Field Detail |
---|
public static SystemLog noteLog
public static SystemLog errorLog
public static SystemLog warningLog
protected java.io.PrintWriter stream
protected boolean logStackTraces
protected boolean timestampUsed
protected java.text.DateFormat timestamp
Constructor Detail |
---|
public SystemLog()
public SystemLog(java.io.PrintWriter stream)
Method Detail |
---|
public static void logNote(java.lang.String msg)
public static void logError(java.lang.String msg)
public static void logWarning(java.lang.String msg)
public static void logException(java.lang.String msg, java.lang.Throwable throwable)
public java.io.PrintWriter getPrintWriter()
public void setPrintWriter(java.io.PrintWriter stream)
stream
- the stream to append messages to.public boolean getLogStackTraces()
public void setLogStackTraces(boolean logStackTraces)
logStackTraces
- whether stack traces are appended to log when printToLog() is called.public boolean isTimestampUsed()
public void setTimestampUsed(boolean timestampUsed)
timestampUsed
- whether time stamps are appended to log when printToLog() is called.public java.text.DateFormat getTimestamp()
public void setTimestamp(java.text.DateFormat timestamp)
timestamp
- the time stamp format used when appending the time to the log.public void printStackTrace()
public void handleError(com.sas.ComponentInterface component, com.sas.text.Message message, java.lang.String messageCode)
handleError
in interface ErrorHandlerInterface
component
- The component on which the error occured.message
- A Message object with formatted with the message to display.
The object should also contain the necessary arguments for
formatting the message.messageCode
- A non-translatable string which indicates the type of error that occured.ErrorHandlerInterface
public void printToLog(java.lang.String type, java.lang.String msg)
type
- The type of message : Error, Warning, or Notemsg
- The message to print to the log.public void clear()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |