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.
|
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.
|
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, readStringFromSTAFLog, readUIntFromSTAFLog, setDebugLog, setHandle, stafLogLog, stafLogLog, stafLogRequest
fileExists, getAbsolutePath, getFileSpec, getParentDir, isFileSpecAbsolute, setParentDir
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 STAFFileLogItem
public void setCapXML(boolean capbool)
capbool
- public boolean getCapXML()
public void logMessage(java.lang.String msg, java.lang.String desc, int msgType)
logMessage
in class LogItem
msg
- 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 STAFFileLogItem
STAFLogException
- 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 STAFFileLogItem
out
- PrintWriterprotected void appendFinalLog(java.io.Writer out)
appendFinalLog
in class STAFFileLogItem
out
- PrintWriterCopyright © SAS Institute. All Rights Reserved.