|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmlspecs.eclipse.jdt.internal.compiler.util.Log
public class Log
This class provides a uniform interface for logging informational and error messages. Do not use it for messages to the user in the course of normal interaction with the tool. Instead, the informational output is for debugging and tracing purposes; the error output is for internal error reporting (and not, for example, for reports to users about erroneous user input).
Log.on is a boolean flag to be used in user code as a convenience
test, as in
if (Log.on) Log.log(msg);
The test happens before the method call.
Note that output sent to System.out may be lost depending on
the manner in which Eclipse is started (it might also end up
in a command terminal or in a parent Console during plugin
development).
Field Summary | |
---|---|
static Log |
log
Holds a current value for the log object, for convenience |
static boolean |
on
A flag used to record whether or not to output tracing information. |
Constructor Summary | |
---|---|
Log()
|
Method Summary | |
---|---|
static void |
errorlog(java.lang.String msg,
java.lang.Throwable e)
Records an error message to the current log |
void |
ierrorlog(java.lang.String msg,
java.lang.Throwable e)
Records an error message to the current log |
void |
ilog(java.lang.String msg)
Records an informational message to the current log |
static void |
initializeState(boolean on)
Initializes any internal state of the log, e.g. |
static void |
log(java.lang.String msg)
Records an informational message to the current log |
static java.io.PrintStream |
logPrintStream()
Creates a PrintStream that, when written to, writes to the Eclipse Console of the current log object |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Log log
public static boolean on
Constructor Detail |
---|
public Log()
Method Detail |
---|
public static void initializeState(boolean on)
on
- Sets (globally) whether anything is desired to be logged or not.
This is simply to be tested in code prior to calling log() or errorlog(),
to avoid the method invocation when logging is off, as in
if (Log.on) Log.log(msg);public static void log(java.lang.String msg)
msg
- The message to logpublic static void errorlog(java.lang.String msg, java.lang.Throwable e)
msg
- The message to loge
- An associated exception (may be null)public void ilog(java.lang.String msg)
msg
- The message to loge
- An associated exception (may be null)public void ierrorlog(java.lang.String msg, java.lang.Throwable e)
msg
- The message to loge
- An associated exception (may be null)public static java.io.PrintStream logPrintStream()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |