|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.util.Log
Field Summary | |
static Log |
current
Current log instance. |
protected static java.lang.String |
DEFAULT_LOG_FILENAME
Default file name for the log file. |
protected boolean |
ignore
If true, ignore all messages. |
protected java.lang.String |
logFilePath
File pathname for the log file. |
protected java.io.PrintWriter |
printWriter
PrintWriter object for the log file. |
protected java.io.BufferedWriter |
writer
BufferedWriter object for the log file. |
protected boolean |
writeToErr
If true, write error messages to System.err. |
protected boolean |
writeToFile
If true, write messages to the log file. |
protected boolean |
writeToOut
If true, write messages to System.out. |
Constructor Summary | |
Log()
Constructs a new Log object. |
|
Log(java.lang.String logFilePath)
Constructs a new Log object given the path. |
|
Log(java.lang.String logFilePath,
boolean writeToFile,
boolean writeToErr,
boolean writeToOut,
boolean ignore)
Constructs a new Log object given all parameters. |
Method Summary | |
void |
close()
Closes the log file. |
void |
errorPrintln(java.lang.String errorMessage)
Writes the error message to the log. |
java.lang.String |
getStorageLocation()
Returns the path of the log file. |
static void |
makeLog()
Constructs a new Log object and store a reference to it at the Log class. |
void |
print(java.lang.String message)
Writes the String message to the log. |
void |
println()
Writes a newline to the log. |
void |
println(int message)
Writes the int message to the log. |
void |
println(java.lang.String message)
Writes the String message to the log. |
void |
printStackTrace(java.lang.Exception exception)
Writes the exception stack trace to the log. |
static void |
setCurrent(Log log)
Sets the current log instance. |
void |
setStorageLocation(java.lang.String location)
Sets the log file path to the specified location. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static Log current
protected boolean writeToFile
protected boolean writeToErr
protected boolean writeToOut
protected boolean ignore
protected java.lang.String logFilePath
protected java.io.PrintWriter printWriter
protected java.io.BufferedWriter writer
protected static final java.lang.String DEFAULT_LOG_FILENAME
Constructor Detail |
public Log()
public Log(java.lang.String logFilePath)
logFilePath
- specifies the path for the log file.public Log(java.lang.String logFilePath, boolean writeToFile, boolean writeToErr, boolean writeToOut, boolean ignore)
logFilePath
- specifies the path for the log file.writeToFile
- if true, write messages to the log file.writeToErr
- if true, write error messages to System.err.writeToOut
- if true, write messages to System.out.ignore
- if true, ignore all messages.Method Detail |
public static void makeLog()
public void setStorageLocation(java.lang.String location) throws java.io.IOException
public java.lang.String getStorageLocation()
public void println(int message)
message
- the int message to be logged.public void println()
public void print(java.lang.String message)
message
- the String message to be logged.public void println(java.lang.String message)
message
- the String message to be logged.public void errorPrintln(java.lang.String errorMessage)
errorMessage
- the error message to be logged.public void printStackTrace(java.lang.Exception exception)
exception
- the exception to be reported.public void close()
public static void setCurrent(Log log)
log
- a log object.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |