public static class Debug.Log extends Object implements Serializable, RevisionHandler
Debug.SimpleLog
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected String |
m_Filename
the filename, if any
|
protected Logger |
m_Logger
the actual logger, if null only stdout is used
|
protected boolean |
m_LoggerInitFailed
whether the initialization of the logger failed
|
protected int |
m_NumFiles
the number of files for rotating the logs
|
protected int |
m_Size
the size of the file (in bytes)
|
Constructor and Description |
---|
Log()
default constructor, uses only stdout
|
Log(String filename)
creates a logger that logs into the specified file, if null then only
stdout is used.
|
Log(String filename,
int size,
int numFiles)
creates a logger that logs into the specified file, if null then only
stdout is used.
|
Modifier and Type | Method and Description |
---|---|
String |
getFilename()
returns the filename of the log, can be null
|
protected Logger |
getLogger()
initializes and returns the logger if necessary (e.g., due to
serialization).
|
int |
getNumFiles()
returns the number of files being used
|
String |
getRevision()
Returns the revision string.
|
int |
getSize()
returns the size of the files
|
void |
log(Level level,
String message)
logs the given message
|
void |
log(Level level,
String sourceclass,
String message)
prints the given message with the specified level
|
void |
log(Level level,
String sourceclass,
String sourcemethod,
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 Level |
stringToLevel(String level)
turns the string representing a level, e.g., "FINE" or "ALL" into
the corresponding level (case-insensitive).
|
String |
toString()
returns a string representation of the logger
|
protected transient Logger m_Logger
protected String m_Filename
protected int m_Size
protected int m_NumFiles
protected boolean m_LoggerInitFailed
public Log()
public Log(String filename)
filename
- the file to log intopublic Log(String filename, int size, int numFiles)
filename
- the file to log intosize
- the size of the files in bytesnumFiles
- the number of files for rotatingprotected Logger getLogger()
public static Level stringToLevel(String level)
level
- the string to return a level forpublic String getFilename()
public int getSize()
public int getNumFiles()
public void log(Level level, String message)
level
- the level of severitymessage
- the message to logpublic void log(Level level, String sourceclass, String message)
level
- the level of loggingsourceclass
- the class that logs the messagemessage
- the message to printpublic void log(Level level, String sourceclass, String sourcemethod, 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 String toString()
public String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.