public class Log extends Object
out(Class)
.out(Class)
.debug( logMessage )
out(Class)
.out(Class)
.info( logMessage )
out(Class)
.out(Class)
.warn( logMessage )
out(Class)
.out(Class)
.error( logMessage, exception )
Modifier and Type | Field and Description |
---|---|
static String |
DEBUG
DEBUG log message type
|
protected static String |
DEFAULT_FORMAT
Standard BioLockJ log format includes date, time, severity type, and calling class before the msg.
|
protected static String |
DIRECT_FORMAT
Direct BioLockJ log prefix includes only the msg.
|
static String |
ERROR
ERROR log message type
|
static String |
INFO
INFO log message type
|
protected static String |
LOG_APPEND
Set in
initialize(String) to true only if executing pipeline restart.Used by log4j.properties log4j.appender.file.Append=${LOG_APPEND} |
protected static String |
LOG_FILE
Set in
initialize(String) to file path of pipeline Java log fileUsed by log4j.properties log4j.appender.file.File=${LOG_FILE} |
static String |
WARN
WARN log message type
|
Modifier and Type | Method and Description |
---|---|
static void |
debug(Class<?> loggingClass,
String msg)
Print log level DEBUG message.
Do not print MetaUtil debug since these will always print since the Logger isn't
initialized yet and logMesseges will print them as INFO after Log file initializes. |
static boolean |
doDebug()
Return TRUE if = DEBUG.
|
static void |
enableLogs(boolean enable)
Boolean toggle to enable/disable all log messages
|
static void |
error(Class<?> myClass,
String msg)
Print log level ERROR message without exception stacktrace
|
static void |
error(Class<?> myClass,
String msg,
Exception exception)
Print log level ERROR message.
|
static File |
getFile()
Returns the log file.
|
static List<String[]> |
getMsgs()
Get the logMesseges created prior to creating the actual
LOG_FILE |
static void |
info(Class<?> myClass,
String msg)
Print log level INFO message.
|
static void |
initialize(String name)
Called by
BioLockJ.main() after Config is initialized. |
protected static void |
logConfig()
Prints
Config properties to the Java log file. |
protected static void |
logWelcomeMsg()
Print welcome message.
Message includes BioLockJ version BioLockJUtil.getVersion() , lab citation, and freeware
blurb. |
static org.slf4j.Logger |
out(Class<?> callingClass)
Returns the Logger for the callingClass.
|
protected static String |
validateLogLevel()
Validate log level is configured to one of the valid Log4J options: DEBUG, INFO, WARN, ERROR
|
static void |
warn(Class<?> myClass,
String msg)
Print log level WARN message.
|
public static String DEBUG
public static String ERROR
public static String INFO
public static String WARN
protected static final String DEFAULT_FORMAT
protected static final String DIRECT_FORMAT
protected static final String LOG_APPEND
initialize(String)
to true only if executing pipeline restart.protected static final String LOG_FILE
initialize(String)
to file path of pipeline Java log filepublic static void debug(Class<?> loggingClass, String msg)
MetaUtil
debug since these will always print since the Logger isn't
initialized yet and logMesseges will print them as INFO after Log file initializes.loggingClass
- Logging classmsg
- Message to logpublic static boolean doDebug() throws Exception
Exception
- if errors occurpublic static void enableLogs(boolean enable)
enable
- booleanpublic static void error(Class<?> myClass, String msg)
myClass
- Logging classmsg
- Message to logpublic static void error(Class<?> myClass, String msg, Exception exception)
myClass
- Logging classmsg
- Message to logexception
- Cause of the errorpublic static File getFile()
public static List<String[]> getMsgs()
LOG_FILE
public static void info(Class<?> myClass, String msg)
myClass
- Logging classmsg
- Message to logpublic static void initialize(String name) throws Exception
BioLockJ.main()
after Config
is initialized.
Create Java Log4J log file in Config
."internal.pipelineDir", named
after the project.
LOG_FILE
and LOG_APPEND
in System
properties to be used by
log4j.properties
Config
property values to log file as INFO
public static org.slf4j.Logger out(Class<?> callingClass)
callingClass
- Java class in need of Loggerpublic static void warn(Class<?> myClass, String msg)
myClass
- Logging classmsg
- Message to logprotected static void logConfig()
Config
properties to the Java log file.protected static void logWelcomeMsg() throws Exception
BioLockJUtil.getVersion()
, lab citation, and freeware
blurb.Exception
- if errors occur