|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.Debug.Log
public static class Debug.Log
A helper class for logging stuff. Uses the java.util.logging package. If this approach seems an "overkill" (it can create quite a few log files if used in different threads), one can use the Debug.SimpleLog class.
Debug.SimpleLog
,
Serialized FormConstructor Summary | |
---|---|
Debug.Log()
default constructor, uses only stdout |
|
Debug.Log(java.lang.String filename)
creates a logger that logs into the specified file, if null then only stdout is used. |
|
Debug.Log(java.lang.String filename,
int size,
int numFiles)
creates a logger that logs into the specified file, if null then only stdout is used. |
Method Summary | |
---|---|
java.lang.String |
getFilename()
returns the filename of the log, can be null |
int |
getNumFiles()
returns the number of files being used |
java.lang.String |
getRevision()
Returns the revision string. |
int |
getSize()
returns the size of the files |
void |
log(java.util.logging.Level level,
java.lang.String message)
logs the given message |
void |
log(java.util.logging.Level level,
java.lang.String sourceclass,
java.lang.String message)
prints the given message with the specified level |
void |
log(java.util.logging.Level level,
java.lang.String sourceclass,
java.lang.String sourcemethod,
java.lang.String message)
prints the given message with the specified level |
void |
logSystemInfo()
a convenience method for dumping the current system info in the log file |
static java.util.logging.Level |
stringToLevel(java.lang.String level)
turns the string representing a level, e.g., "FINE" or "ALL" into the corresponding level (case-insensitive). |
java.lang.String |
toString()
returns a string representation of the logger |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Debug.Log()
public Debug.Log(java.lang.String filename)
filename
- the file to log intopublic Debug.Log(java.lang.String filename, int size, int numFiles)
filename
- the file to log intosize
- the size of the files in bytesnumFiles
- the number of files for rotatingMethod Detail |
---|
public static java.util.logging.Level stringToLevel(java.lang.String level)
level
- the string to return a level for
public java.lang.String getFilename()
public int getSize()
public int getNumFiles()
public void log(java.util.logging.Level level, java.lang.String message)
level
- the level of severitymessage
- the message to logpublic void log(java.util.logging.Level level, java.lang.String sourceclass, java.lang.String message)
level
- the level of loggingsourceclass
- the class that logs the messagemessage
- the message to printpublic void log(java.util.logging.Level level, java.lang.String sourceclass, java.lang.String sourcemethod, java.lang.String message)
level
- the level of loggingsourceclass
- the class that logs the messagesourcemethod
- the method that logs the messagemessage
- the message to printpublic void logSystemInfo()
SystemInfo
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |