|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kotkabeans.Log
Title: Log
Description: Logs things to logfile
Copyright: Copyright (c) KORPPI-PROJEKTIRYHMÄ 2002
Company: Jyu
Usage:
To log allways use static methods Log.log("sentence");
Nested Class Summary | |
static class |
Log.NamedLog
Title: NamedLog Description: Named log file to log if this log is needed Copyright: jyu Copyright (c) 2002 Company: jty Usage: To log only when selected to log, use named logs Log.NamedLog debugLog = Log.getLog("debug"); debugLog.log("sentence"); To change named log active or not active debugLog.setActive(true); |
Field Summary | |
protected static java.text.DateFormat |
df
|
protected static java.util.Collection |
ignoreCallsList
|
protected static java.io.PrintWriter |
logFile
|
protected static java.lang.String |
logfilename
|
protected static java.util.Map |
namedLogs
|
protected static boolean |
openTried
|
Constructor Summary | |
Log()
Constructor opens the file one time |
Method Summary | |
static void |
addIgnoreCallList(java.lang.String s)
Adds a new mask to ignoreCallList |
static java.lang.String |
getIgnoreCallsList()
Get what words to ignore from call stack |
static Log.NamedLog |
getLog(java.lang.String ln)
Finds or creates named log with name ln |
static java.lang.String |
getLogfilename()
Get name for current logfile |
static java.lang.String |
getStack()
Return current call stack as string |
static java.lang.String |
getStack(int ignoreCalls)
Returns current call stack. |
protected static void |
initLogFile()
Initialize the log file one time. |
static void |
log(java.lang.String sentence)
Logs the sentence to log file |
static void |
log(java.lang.String sentence,
java.lang.Exception e)
Logs the sentence and exception message and stack to logfile |
static void |
logStack()
Logs current call stack to logfile |
static void |
logStack(int ignoreCalls)
Logs current call stack to logfile |
static void |
setIgnoreCallsList(java.lang.String ilist)
Set list of lines to ignore from call stack |
static void |
setLogfilename(java.lang.String lfn)
Set logfilename. |
static java.lang.String |
stackToString(java.lang.Throwable th)
Returns stack as a string |
static java.lang.String |
suppressStack(java.lang.String st,
int ignoreCalls)
Returns stack supressed with ignoreCalls from begining and then with ignoreCallsList |
static java.lang.String |
suppressStack(java.lang.String st,
int ignoreCalls,
java.util.Collection ignoreCallsList)
Returns stack supressed with ignoreCalls from begining and then with ignoreCallsList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.io.PrintWriter logFile
protected static boolean openTried
protected static java.text.DateFormat df
protected static java.util.Collection ignoreCallsList
protected static java.util.Map namedLogs
protected static java.lang.String logfilename
Constructor Detail |
public Log()
Method Detail |
public static Log.NamedLog getLog(java.lang.String ln)
ln
- Name for log to return
public static void addIgnoreCallList(java.lang.String s)
s
- Mask to add to listpublic static void setIgnoreCallsList(java.lang.String ilist)
ilist
- List of "words" to ignore from call stack separated by ;public static java.lang.String getIgnoreCallsList()
public static void setLogfilename(java.lang.String lfn)
lfn
- New name for logfilepublic static java.lang.String getLogfilename()
protected static void initLogFile()
public static java.lang.String stackToString(java.lang.Throwable th)
th
- - throwable where the stack is extracted
public static java.lang.String suppressStack(java.lang.String st, int ignoreCalls, java.util.Collection ignoreCallsList)
st
- Stack as string to suppressignoreCalls
- how many calls removed from beginingignoreCallsList
- String array of rows to suppress
public static java.lang.String suppressStack(java.lang.String st, int ignoreCalls)
st
- Stack as string to suppressignoreCalls
- how many calls removed from begining
public static java.lang.String getStack(int ignoreCalls)
ignoreCalls
- how many call is ignored form the top of stack
public static java.lang.String getStack()
public static void logStack(int ignoreCalls)
ignoreCalls
- how many call levels ignoredpublic static void logStack()
public static void log(java.lang.String sentence)
sentence
- String to logpublic static void log(java.lang.String sentence, java.lang.Exception e)
sentence
- String to loge
- Exception to log
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |