|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.eventgnosis.util.Log
Simple logging class. Primary features: 1. Has categories 2. Can be redirected/turned off ( to DevNull, Stdout, LogFile )
Field Summary | |
static java.lang.String |
DEF_HOME_DIR
|
static java.lang.String |
FILE_SEP
|
static int |
MAX_RECORDED_ERRS
|
static int |
TO_LOGFILE
|
static java.lang.String |
TO_LOGFILE_LBL
|
static int |
TO_NULL
|
static java.lang.String |
TO_NULL_LBL
|
static int |
TO_STDOUT
|
static java.lang.String |
TO_STDOUT_LBL
|
Constructor Summary | |
Log(java.lang.String homeDir)
Creates a new instance of the Log class and its log file in folder specified by homeDir parameter. |
Method Summary | |
int |
charToMode(char c)
|
void |
err(java.lang.String str)
Log the str parameter to the error out. |
void |
flush()
Flushes the log. |
java.util.ArrayList |
getErrorList()
Returns a list of accumulated errors since last call of this method. |
com.eventgnosis.util.Log.LogFunctor |
getFunctor(int mode,
java.lang.String pre,
java.util.List list)
|
java.lang.String |
getLogFileName()
Full path of the log file name. |
java.util.ArrayList |
getWarningList()
Returns a list of accumulated warnings since last call of this method. |
void |
info(java.lang.String str)
Log the str parameter to info out. |
static void |
main(java.lang.String[] args)
|
void |
setModes(int eCtrl,
int wCtrl,
int iCtrl)
Specifies log's out for each particular type of message ( error , warning and info ).
(0=DevNull, 1=Stdout, 2=LogFile ) |
void |
setModes(java.lang.String ctrl)
Specifies outs for each particular type of message (error, warning and info), by log modes parameter string. The log modes string contains err, warn, info parameters respectively. Example: "110" means that error and warning messages will be logged to stdout, but info messages to DevNull. |
void |
shutdown()
Flushes and closes the log. |
java.lang.String |
toString()
|
void |
warn(java.lang.String str)
Log the str parameter to warning out. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static java.lang.String DEF_HOME_DIR
public static java.lang.String FILE_SEP
public static final int MAX_RECORDED_ERRS
public static final int TO_LOGFILE
public static final java.lang.String TO_LOGFILE_LBL
public static final int TO_NULL
public static final java.lang.String TO_NULL_LBL
public static final int TO_STDOUT
public static final java.lang.String TO_STDOUT_LBL
Constructor Detail |
public Log(java.lang.String homeDir)
homeDir
- - target directory for logging.Method Detail |
public int charToMode(char c)
public void err(java.lang.String str)
str
parameter to the error out.
str
- - string to be loggedpublic void flush()
public java.util.ArrayList getErrorList()
public com.eventgnosis.util.Log.LogFunctor getFunctor(int mode, java.lang.String pre, java.util.List list)
public java.lang.String getLogFileName()
public java.util.ArrayList getWarningList()
public void info(java.lang.String str)
str
parameter to info out.
str
- - string to be loggedpublic static void main(java.lang.String[] args)
public void setModes(int eCtrl, int wCtrl, int iCtrl)
error
, warning
and info
).
(0=DevNull, 1=Stdout, 2=LogFile )
eCtrl
- - errorwCtrl
- - warningiCtrl
- - infopublic void setModes(java.lang.String ctrl)
ctrl
- - log modes stringpublic void shutdown()
public java.lang.String toString()
public void warn(java.lang.String str)
str
parameter to warning out.
str
- - string to be logged
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |