public class CustomLogFac
extends java.lang.Object
AbstractSAFSCustomLoggingService
provide a sample custom
logging service implementation that writes directly to the STAF logs.Modifier and Type | Field and Description |
---|---|
static int |
CUSTOM_MESSAGE |
static int |
DEBUG_MESSAGE |
static int |
END_COUNTER |
static int |
END_CYCLE |
static int |
END_DATATABLE |
static int |
END_PROCEDURE |
static int |
END_REQUIREMENT |
static int |
END_SUITE |
static int |
END_TESTCASE |
static int |
FAILED_MESSAGE |
static int |
FAILED_OK_MESSAGE |
static int |
GENERIC_MESSAGE |
static long |
LOGMODE_CONSOLE
Bit flag constant for enabling tool's console log.
|
static long |
LOGMODE_DISABLED
Disable all logs.
|
static long |
LOGMODE_MAX
Enable all logs.
|
static long |
LOGMODE_SAFS_TEXT
Bit flag constant for enabling standard SAFS text file log.
|
static long |
LOGMODE_SAFS_XML
Bit flag constant for enabling standard SAFS xml file log.
|
static long |
LOGMODE_TOOL
Bit flag constant for enabling tool specific log.
|
static int |
PASSED_MESSAGE |
static int |
RESUME_STATUS_COUNTS |
static int |
SKIPPED_TEST_MESSAGE |
static int |
START_COUNTER |
static int |
START_CYCLE |
static int |
START_DATATABLE |
static int |
START_LOGGING |
static int |
START_PROCEDURE |
static int |
START_REQUIREMENT |
static int |
START_SUITE |
static int |
START_TESTCASE |
static int |
STATUS_REPORT_END |
static int |
STATUS_REPORT_GENERAL_FAILURES |
static int |
STATUS_REPORT_GENERAL_WARNINGS |
static int |
STATUS_REPORT_IO_FAILURES |
static int |
STATUS_REPORT_RECORDS |
static int |
STATUS_REPORT_SKIPPED |
static int |
STATUS_REPORT_START |
static int |
STATUS_REPORT_TEST_FAILURES |
static int |
STATUS_REPORT_TEST_PASSES |
static int |
STATUS_REPORT_TEST_WARNINGS |
static int |
STATUS_REPORT_TESTS |
static int |
STOP_LOGGING |
static int |
SUSPEND_STATUS_COUNTS |
static int |
WARNING_MESSAGE |
static int |
WARNING_OK_MESSAGE |
Constructor and Description |
---|
CustomLogFac(java.lang.String name,
long mode,
java.lang.String linked,
HandleInterface h,
java.lang.String stafLog)
Creates a
CustomLogFac . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes all logs of this log facility.
|
java.lang.String |
getFacName()
Returns the name of this log facility.
|
boolean |
isModeEnabled(long mode)
Tests if the specified log mode is enabled.
|
com.ibm.staf.STAFResult |
logMessage(java.lang.String msg,
java.lang.String desc,
int msgType)
Logs a message to all the enabled logs.
|
public static final int START_PROCEDURE
public static final int END_PROCEDURE
public static final int START_DATATABLE
public static final int START_TESTCASE
public static final int START_SUITE
public static final int END_SUITE
public static final int END_TESTCASE
public static final int START_CYCLE
public static final int END_CYCLE
public static final int START_COUNTER
public static final int END_COUNTER
public static final int SUSPEND_STATUS_COUNTS
public static final int RESUME_STATUS_COUNTS
public static final int START_LOGGING
public static final int STOP_LOGGING
public static final int STATUS_REPORT_START
public static final int STATUS_REPORT_RECORDS
public static final int STATUS_REPORT_SKIPPED
public static final int STATUS_REPORT_TESTS
public static final int STATUS_REPORT_TEST_PASSES
public static final int STATUS_REPORT_TEST_WARNINGS
public static final int STATUS_REPORT_TEST_FAILURES
public static final int STATUS_REPORT_GENERAL_WARNINGS
public static final int STATUS_REPORT_GENERAL_FAILURES
public static final int STATUS_REPORT_IO_FAILURES
public static final int STATUS_REPORT_END
public static final int START_REQUIREMENT
public static final int END_REQUIREMENT
public static final int SKIPPED_TEST_MESSAGE
public static final int END_DATATABLE
public static final int DEBUG_MESSAGE
public static final int GENERIC_MESSAGE
public static final int FAILED_MESSAGE
public static final int FAILED_OK_MESSAGE
public static final int PASSED_MESSAGE
public static final int WARNING_MESSAGE
public static final int WARNING_OK_MESSAGE
public static final int CUSTOM_MESSAGE
public static final long LOGMODE_DISABLED
LogItem
type.public static final long LOGMODE_TOOL
LogItem
as a tool-specific log.public static final long LOGMODE_CONSOLE
LogItem
as a tool-specific console log.public static final long LOGMODE_SAFS_TEXT
LogItem
as standard SAFS text file log.public static final long LOGMODE_SAFS_XML
LogItem
as standard SAFS xml file log.public static final long LOGMODE_MAX
LogItem
type.public CustomLogFac(java.lang.String name, long mode, java.lang.String linked, HandleInterface h, java.lang.String stafLog)
CustomLogFac
.
name
- the name of this custom log facility.mode
- the log mode of this custom log facility.linked
- the name of the log facility linked to this one.h
- the STAF handle for interacting with STAF.stafLog
- the name of the STAF Log service loaded by standard
logging service.public java.lang.String getFacName()
public boolean isModeEnabled(long mode)
mode
- the mode to test. Must be one of the LOGMODE
constants.true
if mode
is enabled;
false
if not.public com.ibm.staf.STAFResult logMessage(java.lang.String msg, java.lang.String desc, int msgType)
msg
- the message to log.desc
- additional description to log.msgType
- the int identifier of the type of message being logged.STAFResult.Ok
and the result buffer is
"BYPASS".public void close()
Copyright © SAS Institute. All Rights Reserved.