Package weka.core
Class Debug.SimpleLog
java.lang.Object
weka.core.Debug.SimpleLog
- All Implemented Interfaces:
Serializable
,RevisionHandler
- Enclosing class:
- Debug
A little, simple helper class for logging stuff. Uses simple file access
and not the java.util.logging stuff (see Log for that). Uses the
writeToFile methods of the Debug class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreturns the filename of the log, can be nullReturns the revision string.void
logs the given message to the filevoid
a convenience method for dumping the current system info in the log filetoString()
returns a string representation of the logger
-
Constructor Details
-
SimpleLog
public SimpleLog()default constructor, uses only stdout -
SimpleLog
Creates a logger that writes into the specified file. Appends to the file by default.- Parameters:
filename
- the file to write to, if null then only stdout is used
-
SimpleLog
Creates a logger that writes into the specified file. Appends to the file by default.- Parameters:
filename
- the file to write to, if null then only stdout is usedappend
- if false, the file will be deleted first
-
-
Method Details
-
getFilename
returns the filename of the log, can be null- Returns:
- the filename of the log
-
log
logs the given message to the file- Parameters:
message
- the message to log
-
logSystemInfo
public void logSystemInfo()a convenience method for dumping the current system info in the log file- See Also:
-
toString
returns a string representation of the logger -
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-