public class SAFSLoggerFactory
extends java.lang.Object
implements org.slf4j.ILoggerFactory
The Factory supports 3 kinds of Loggers that can be retrieved by Name:
At this time, SAFS Loggers that write to the SAFS Test Log *MUST* be further initialized AFTER they are returned by the SAFSLogFactory. Since these Adapters are primarily intended for integrating non-SAFS tools using SLF4J logging into the SAFS framework or test, this is usually not an issue.
The typical mechanism for using the SAFS Logger Adapters would be:
Logger logger = LoggerFactory.getLogger(MySAFSAwareClass.class);
SAFSLoggerFactory.initializeTestLoggerAdapter(logger, driver);
initializeTestLoggerAdapter(Logger, AbstractDriver)
Modifier and Type | Field and Description |
---|---|
static boolean |
accpetDebugLog
If the message from slf4j will go into safs debug log.
|
static boolean |
accpetTestLog
If the message from slf4j will go into safs test log.
|
static java.lang.String |
DEBUG_LOGNAME
"DEBUG" Name of the Adapter to facilitate SAFS Debug Logging.
|
protected DebugLoggerAdapter |
debuglog |
protected CombinedLoggerAdapter |
duallog |
protected TestLoggerAdapter |
safslog |
static java.lang.String |
TEST_LOGNAME
"TEST" Name of the Adapter to facilitate SAFS Test Logging.
|
protected VoidLoggerAdapter |
voidlog |
Constructor and Description |
---|
SAFSLoggerFactory() |
Modifier and Type | Method and Description |
---|---|
org.slf4j.Logger |
getLogger(java.lang.String logname)
Specify which Logger Adapter is desired.
DEBUG_LOGNAME returns the SAFS Debug Log Adapter.TEST_LOGNAME returns the SAFS Test Log Adapter.An unrecognized or unknown logname/classname will return the SAFS Combined Logger Adapter. |
static void |
initializeTestLoggerAdapter(org.slf4j.Logger logger,
AbstractDriver driver)
At this time, SAFS Loggers that write to the SAFS Test Log *MUST* be further initialized AFTER they
are returned by the SAFSLogFactory.
|
public static boolean accpetDebugLog
public static boolean accpetTestLog
public static final java.lang.String DEBUG_LOGNAME
public static final java.lang.String TEST_LOGNAME
protected final TestLoggerAdapter safslog
protected final DebugLoggerAdapter debuglog
protected final CombinedLoggerAdapter duallog
protected final VoidLoggerAdapter voidlog
public org.slf4j.Logger getLogger(java.lang.String logname)
DEBUG_LOGNAME
returns the SAFS Debug Log Adapter.TEST_LOGNAME
returns the SAFS Test Log Adapter.getLogger
in interface org.slf4j.ILoggerFactory
ILoggerFactory.getLogger(java.lang.String)
,
DebugLoggerAdapter, TestLoggerAdapter, CombinedLoggerAdapter
public static void initializeTestLoggerAdapter(org.slf4j.Logger logger, AbstractDriver driver)
The typical mechanism for using the SAFS Logger Adapters would be:
Logger logger = LoggerFactory.getLogger(MySAFSAwareClass.class);
SAFSLoggerFactory.initializeTestLoggerAdapter(logger, driver);
logger
- driver
- --AbstractDrivers like JSAFSDriver, SAFSDRIVER, and STAFProcessContainer providing access
to a SAFS CoreInterface (STAFHelper subclass).Copyright © SAS Institute. All Rights Reserved.