public abstract class AbstractSTAFXmlLogItem extends STAFFileLogItem
Note that logging function of this class is for local use only.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
capXML
TRUE if the XML log should be capped at closure.
|
protected static java.lang.String |
PROPERTY_DATE |
protected static java.lang.String |
PROPERTY_IP |
protected static java.lang.String |
PROPERTY_MACHINE |
protected static java.lang.String |
PROPERTY_MAJOR |
protected static java.lang.String |
PROPERTY_MINOR |
protected static java.lang.String |
PROPERTY_NAME |
protected static java.lang.String |
PROPERTY_TIME |
protected static java.lang.String |
PROPERTY_TYPE |
protected static java.lang.String |
PROPERTY_USER |
protected static java.lang.String |
TAG_LOG_CLOSED |
protected static java.lang.String |
TAG_LOG_MESSAGE |
protected static java.lang.String |
TAG_LOG_OPENED |
protected static java.lang.String |
TAG_LOG_VERSION |
protected static java.lang.String |
TAG_MESSAGE_DETAILS |
protected static java.lang.String |
TAG_MESSAGE_TEXT |
protected static java.lang.String |
TAG_SAFS_LOG |
protected static java.lang.String |
TAG_STATUS_END_DETAILS |
protected static java.lang.String |
TAG_STATUS_END_TEXT |
protected static java.lang.String |
TAG_STATUS_ITEM |
protected static java.lang.String |
TAG_STATUS_ITEM_DETAILS |
protected static java.lang.String |
TAG_STATUS_ITEM_TEXT |
protected static java.lang.String |
TAG_STATUS_REPORT |
protected static java.lang.String |
TAG_STATUS_START_DETAILS |
protected static java.lang.String |
TAG_STATUS_START_TEXT |
debugLog, handle, LINEFEED, SAFSLOG_MAJOR_VER, SAFSLOG_MINOR_VER, STAFVersion| Constructor and Description |
|---|
AbstractSTAFXmlLogItem(java.lang.String file)
Creates a disabled
AbstractSTAFXmlLogItem with default name (file
name) and log level (LOGLEVEL_INFO), and empty parent
directory. |
AbstractSTAFXmlLogItem(java.lang.String parent,
java.lang.String file)
Creates a disabled
AbstractSTAFXmlLogItem with default name (file
name) and log level (LOGLEVEL_INFO). |
AbstractSTAFXmlLogItem(java.lang.String name,
java.lang.String parent,
java.lang.String file)
Creates a disabled
AbstractSTAFXmlLogItem with default log level
(LOGLEVEL_INFO). |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendFinalLog(java.io.Writer out)
Override superclass prepend to provide a valid XML header if capXML is true.
|
void |
close()
Close this log if enabled and open.
|
protected java.lang.String |
formatMessage(java.lang.String msg,
java.lang.String desc,
MessageTypeInfo info)
Prepares the message to standard SAFS xml format.
|
boolean |
getCapXML()
Returns the current setting of whether the XML log will be capped on closure.
|
protected java.util.List<java.lang.String> |
getCloseMessages()
Return the messages to write before the log is closed.
|
protected java.util.List<java.lang.String> |
getInitMessages()
Return the messages to write after the log is initialized.
|
void |
init()
Initializes this log and writes the log open message.
|
void |
logMessage(java.lang.String msg)
Logs a message in standard SAFS text log format if enabled and open.
|
void |
logMessage(java.lang.String msg,
int msgType)
Logs a message in standard SAFS text log format if enabled and open.
|
void |
logMessage(java.lang.String msg,
java.lang.String desc,
int msgType)
Logs a message in standard SAFS xml log format if enabled and open.
|
protected void |
prependFinalLog(java.io.Writer out)
Override superclass prepend to provide a valid XML header if capXML is true.
|
void |
setCapXML(boolean capbool)
Set true if this log should be "capped" (made valid XML) upon closure.
|
exportSTAFLog, finalizeLogFile, getMachineName, getSTAFLogDirectory, getTestName, readStringFromSTAFLog, readUIntFromSTAFLog, setDebugLog, setHandle, stafLogLog, stafLogLog, stafLogRequest, write, writeCloseMessages, writeInitMessagesfileExists, getAbsolutePath, getFileSpec, getParentDir, isFileSpecAbsolute, setParentDirprotected static final java.lang.String TAG_LOG_OPENED
protected static final java.lang.String TAG_LOG_VERSION
protected static final java.lang.String TAG_LOG_CLOSED
protected static final java.lang.String TAG_SAFS_LOG
protected static final java.lang.String TAG_LOG_MESSAGE
protected static final java.lang.String TAG_MESSAGE_TEXT
protected static final java.lang.String TAG_MESSAGE_DETAILS
protected static final java.lang.String TAG_STATUS_REPORT
protected static final java.lang.String TAG_STATUS_ITEM
protected static final java.lang.String TAG_STATUS_ITEM_TEXT
protected static final java.lang.String TAG_STATUS_ITEM_DETAILS
protected static final java.lang.String TAG_STATUS_START_TEXT
protected static final java.lang.String TAG_STATUS_START_DETAILS
protected static final java.lang.String TAG_STATUS_END_TEXT
protected static final java.lang.String TAG_STATUS_END_DETAILS
protected static final java.lang.String PROPERTY_TYPE
protected static final java.lang.String PROPERTY_DATE
protected static final java.lang.String PROPERTY_TIME
protected static final java.lang.String PROPERTY_USER
protected static final java.lang.String PROPERTY_MACHINE
protected static final java.lang.String PROPERTY_IP
protected static final java.lang.String PROPERTY_NAME
protected static final java.lang.String PROPERTY_MAJOR
protected static final java.lang.String PROPERTY_MINOR
protected boolean capXML
public AbstractSTAFXmlLogItem(java.lang.String name,
java.lang.String parent,
java.lang.String file)
AbstractSTAFXmlLogItem with default log level
(LOGLEVEL_INFO).
The type of this log item is always LOGMODE_SAFS_XML.
name - the name of this log.parent - the parent directory for this log.file - the file spec of this log.public AbstractSTAFXmlLogItem(java.lang.String parent,
java.lang.String file)
AbstractSTAFXmlLogItem with default name (file
name) and log level (LOGLEVEL_INFO).
The type of this log item is always LOGMODE_SAFS_XML.
parent - the parent directory for this log.file - the file spec of this log.public AbstractSTAFXmlLogItem(java.lang.String file)
AbstractSTAFXmlLogItem with default name (file
name) and log level (LOGLEVEL_INFO), and empty parent
directory.
The type of this log item is always LOGMODE_SAFS_XML.
file - the file spec of this log.public void init()
init in class STAFFileLogItemprotected java.util.List<java.lang.String> getInitMessages()
STAFFileLogItemgetInitMessages in class STAFFileLogItemprotected java.util.List<java.lang.String> getCloseMessages()
STAFFileLogItemgetCloseMessages in class STAFFileLogItempublic void setCapXML(boolean capbool)
capbool - public boolean getCapXML()
public void logMessage(java.lang.String msg,
java.lang.String desc,
int msgType)
logMessage in class LogItemmsg - the message to log.desc - additional description to log.msgType - the int identifier of the type of message being logged.public void logMessage(java.lang.String msg,
int msgType)
msg - the message to log.msgType - the int identifier of the type of message being logged.public void logMessage(java.lang.String msg)
Message type defaults to GENERIC_MESSAGE.
msg - the message to log.public void close()
throws STAFLogException
close in class STAFFileLogItemSTAFLogException - if this method failed for any reason.protected java.lang.String formatMessage(java.lang.String msg,
java.lang.String desc,
MessageTypeInfo info)
msg - the message to log.desc - additional description to log.info - the constant info for the message type.
protected void prependFinalLog(java.io.Writer out)
prependFinalLog in class STAFFileLogItemout - PrintWriterprotected void appendFinalLog(java.io.Writer out)
appendFinalLog in class STAFFileLogItemout - PrintWriterCopyright © SAS Institute. All Rights Reserved.