public class SAFSLOGS extends DriverConfiguredSTAFInterfaceClass implements LogsInterface
[STAF] ;NOSTAF=TRUE will launch this service as an embedded services if AUTOLAUNCH=TRUE. [SAFS_LOGS] AUTOLAUNCH=TRUE OVERWRITE=TRUE CAPXML=TRUE TRUNCATE=ON|OFF|#chars ;ITEM=org.safs.tools.logs.SAFSLOGS ;Service=SAFSLOGS ;ServiceClass will be different for STAF2 and STAF3 ;ServiceClass=org.safs.staf.service.logging.v2.SAFSLoggingService ;ServiceClass=org.safs.staf.service.logging.v3.SAFSLoggingService3 ;If we indicate the SERVICEJAR, the jar's manifest file contains the necessary info to ;distinguish the STAF's version, and select the right class to load service ;SERVICEJAR=C:\safs\lib\safslogs.jar ;OPTIONS=
The Driver's 'safs.driver.autolaunch' command-line option is also queried for this setting and overrides any other configuration source setting.
The default AUTOLAUNCH setting is TRUE.
The default OVERWRITE value is FALSE
The default CAPXML value is FALSE. Most users will want to provide this value set to TRUE, unless they intend to cap the XML themselves at some later time.
The default CAPXML value is FALSE. Most users will want to provide this value set to TRUE, unless they intend to cap the XML themselves at some later time.
The default ITEM value is org.safs.tools.logs.SAFSLOGS
The default SERVICECLASS value is org.safs.staf.service.logging.v2.SAFSLoggingService
The default SERVICEJAR value is [safsroot]/lib/safslogs.jar
Modifier and Type | Field and Description |
---|---|
protected boolean |
capXML
Enables "capping" the XML log when it is closed.
|
protected java.lang.String |
classpath
Stores classname or JAR file fullpath for STAF service initialization.
|
protected static java.lang.String |
DEFAULT_EMBEDDED_SAFSLOGS_CLASS
"org.safs.staf.service.logging.EmbeddedLogService"
|
protected static java.lang.String |
DEFAULT_SAFSLOGS_CLASS
"org.safs.staf.service.logging.v2.SAFSLoggingService"
|
protected static java.lang.String |
DEFAULT_SAFSLOGS_CLASS3
"org.safs.staf.service.logging.v3.SAFSLoggingService3"
|
protected static java.lang.String |
DEFAULT_SAFSLOGS_JAR
"safslogs.jar"
|
protected boolean |
overwrite
Enables/Disables previous log overwrite when initializing a new log.
|
protected boolean |
truncate
Enables "TRUNCATE" of log messages.
|
protected int |
truncateLength
Default length of enabled TRUNCATE is 128 chars.
|
config, customStr, customText, debugStr, debugText, driver, DRIVER_TEMP_PROCESS, failedStr, failedText, genericStr, genericText, launchCount, log, machine, otherStr, otherText, passedStr, passedText, processName, running, SAFS_RESBUN_NAME, servicename, shutdownCount, staf, STAFPROC_EXE, warningStr, warningText, weStartedService, weStartedSTAF
DEFAULT_STATUSINFO_ID
Constructor and Description |
---|
SAFSLOGS()
Constructor for SAFSLOGS
|
Modifier and Type | Method and Description |
---|---|
void |
closeAllLogs()
This makes sure that all the open logs are closed.
|
void |
closeLog(UniqueIDInterface log)
This closes the specified Log .
|
protected void |
finalize()
Invoke all superclass finalization.
|
void |
initLog(UniqueLogInterface logInfo)
Initialize/Open the specified log.
|
void |
launchInterface(java.lang.Object configInfo)
Expects a DriverInterface for initialization.
|
void |
logMessage(UniqueMessageInterface message)
Log a message to a particular log.
|
void |
logStatusInfo(UniqueIDInterface log,
StatusInterface info,
java.lang.String infoID)
Log a status report for the particular StatusInterface object provided.
|
void |
reset()
This should probably make sure that all open logs are closed.
|
void |
resumeAllLogs()
Resume loggint to ALL previosly suspended logs.
|
void |
resumeLog(UniqueIDInterface log)
Resume logging to a previously suspended log.
|
void |
setLogLevel(UniqueLogLevelInterface logLevel)
Set/Change the log level or filter for log messages.
|
void |
suspendAllLogs()
Suspend logging to ALL open logs.
|
void |
suspendLog(UniqueIDInterface log)
Suspend logging for a particular log.
|
void |
truncate(boolean enabled)
Enables or disables the truncation of logged messages.
|
void |
truncate(int numchars)
Enables truncation of logged messages to the numchars length provided.
|
configureJSTAFServiceEmbeddedJVMOption, extendedGenericMessage, getCoreInterface, getEmbeddedJVMBinPath, getSTAFHelper, isToolRunning, logMessage, setLogUtilities, setLogUtilities, shutdown, shutdownService, simpleGenericMessage, simpleGenericSuccessMessage, simpleGenericWarningMessage, simpleSuccessMessage, simpleSuccessMessage, simpleSuccessUsingMessage, standardErrorMessage, waitForServiceStartCompletion
protected static final java.lang.String DEFAULT_SAFSLOGS_CLASS
protected static final java.lang.String DEFAULT_SAFSLOGS_CLASS3
protected static final java.lang.String DEFAULT_EMBEDDED_SAFSLOGS_CLASS
protected static final java.lang.String DEFAULT_SAFSLOGS_JAR
protected java.lang.String classpath
protected boolean overwrite
protected boolean capXML
protected boolean truncate
protected int truncateLength
public void launchInterface(java.lang.Object configInfo)
launchInterface
in interface ConfigurableToolsInterface
launchInterface
in class DriverConfiguredSTAFInterfaceClass
configInfo
- can be whatever the final implementation needs it to be. This
might be a String with configuration information, the name of a class, or an instance
of some object used to provide configuration assets.ConfigurableToolsInterface.launchInterface(Object)
public void initLog(UniqueLogInterface logInfo)
LogsInterface
initLog
in interface LogsInterface
Initializes the Log Facility.
It checks the types of logging enabled
on the basis of LOG MODE.
For example if only TextLog or XML log is enabled then
it initializes the LOG Facility with only those two enabled.
It also checks if any alternate name or path
is specified for Text Log and XML log.
Log Facility is still not taken care of.
public void setLogLevel(UniqueLogLevelInterface logLevel)
LogsInterface
public void logMessage(UniqueMessageInterface message)
LogsInterface
public void logStatusInfo(UniqueIDInterface log, StatusInterface info, java.lang.String infoID)
logStatusInfo
in interface LogsInterface
log
- -- String name of an open LogFacility in SAFSLOGS.info
- -- StatusInterface containing status counts.infoID
- -- Name or ID to give to the status information in the log.
This is usually used to show the subject of the status info.
For example, "Regression Test", "TestCase 123456", etc..
DEFAULT_STATUSINFO_ID used if null or zero-length.public void suspendLog(UniqueIDInterface log)
LogsInterface
suspendLog
in interface LogsInterface
This ensure that the specified log is suspended.
public void suspendAllLogs()
LogsInterface
suspendAllLogs
in interface LogsInterface
This ensures that all the Logs are supended.
public void resumeLog(UniqueIDInterface log)
LogsInterface
resumeLog
in interface LogsInterface
This ensures that the specified Log is resumed again.
public void resumeAllLogs()
LogsInterface
resumeAllLogs
in interface LogsInterface
This ensures that all the previously suspended Logs are started again.
public void truncate(int numchars)
truncate
in interface LogsInterface
public void truncate(boolean enabled)
truncate
in interface LogsInterface
public void closeLog(UniqueIDInterface log)
closeLog
in interface LogsInterface
LogsInterface.closeLog(UniqueIDInterface)
public void closeAllLogs()
closeAllLogs
in interface LogsInterface
LogsInterface.closeAllLogs()
public void reset()
reset
in interface GenericToolsInterface
GenericToolsInterface.reset()
protected void finalize() throws java.lang.Throwable
finalize
in class DriverConfiguredSTAFInterfaceClass
java.lang.Throwable
DriverConfiguredSTAFInterfaceClass.finalize()
Copyright © SAS Institute. All Rights Reserved.