public class IndependantLog
extends java.lang.Object
Use reflection for org.safs.Log to do the Log work. By this way, we don't need to import org.safs.Log which will depend on STAF. In some environments, there is no STAF Library. If we import org.safs.Log, there is a compilation error or ClassNotFoundException.
For example, on Android device, we don't have STAF library. But our Droid-Engine needs some classes extending the existing SAFS class who uses org.safs.Log We can replace Log.XXX() by IndependantLog.XXX() in the SAFS class.
Modifier and Type | Class and Description |
---|---|
static class |
IndependantLog.ConsoleDebugListener
an implementation of interface
DebugListener , output debug message to console. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARG_DEBUG
"-debug", if it is present, then show debug message on console
|
Constructor and Description |
---|
IndependantLog() |
Modifier and Type | Method and Description |
---|---|
static void |
debug(java.lang.String message) |
static void |
debug(java.lang.String message,
java.lang.Throwable th) |
static void |
error(java.lang.String message) |
static void |
error(java.lang.String message,
java.lang.Throwable th) |
static DebugListener |
generateConsoleDebugListener()
create a new instance of class
IndependantLog.ConsoleDebugListener |
static void |
generic(java.lang.String message) |
static DebugListener |
getDebugListener() |
static java.lang.String |
getStackTrace(java.lang.Throwable x)
Create a String from a Throwable suitable for debug output that provides
comparable information to x.printStackTrace();
|
static void |
index(java.lang.String message) |
static void |
info(java.lang.String message) |
static void |
info(java.lang.String message,
java.lang.Throwable th) |
static void |
main(java.lang.String[] args)
Used to test methods in this class.
|
static void |
parseArguments(java.lang.String[] args)
Parse an array of arguments, if
ARG_DEBUG is present, then call toConsole() so that the debug message will be output to console. |
static void |
pass(java.lang.String message) |
static void |
resumeLogging() |
static void |
setDebugListener(DebugListener debugListener) |
static void |
suspendLogging() |
static void |
toConsole()
Set
IndependantLog.ConsoleDebugListener to IndependantLog , so that IndependantLog will write debug, info, warn etc. |
static void |
warn(java.lang.String message) |
public static final java.lang.String ARG_DEBUG
public static void suspendLogging()
public static void resumeLogging()
public static DebugListener getDebugListener()
public static void setDebugListener(DebugListener debugListener)
public static void debug(java.lang.String message)
public static void info(java.lang.String message)
public static void index(java.lang.String message)
public static void generic(java.lang.String message)
public static void pass(java.lang.String message)
public static void warn(java.lang.String message)
public static void error(java.lang.String message)
public static void error(java.lang.String message, java.lang.Throwable th)
public static void info(java.lang.String message, java.lang.Throwable th)
public static void debug(java.lang.String message, java.lang.Throwable th)
public static java.lang.String getStackTrace(java.lang.Throwable x)
x
- public static void parseArguments(java.lang.String[] args)
ARG_DEBUG
is present, then call toConsole()
so that the debug message will be output to console.args
- String[], an array of argument to parsepublic static void toConsole()
IndependantLog.ConsoleDebugListener
to IndependantLog
, so that IndependantLog will write debug, info, warn etc. message to console.public static DebugListener generateConsoleDebugListener()
IndependantLog.ConsoleDebugListener
public static void main(java.lang.String[] args)
args
- Copyright © SAS Institute. All Rights Reserved.