|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectLogging
public class Logging
This is an interface to Java's Logger system.
Each J2OManager gets its own logger, which can be individually configured. Log entries are submitted to the logger by one of the methods info, error etc. They are semantically classified and can be selectively turned on and off.
Constructor Summary | |
---|---|
Logging(J2OManager manager)
Creates a new logger for the J2OManager |
Method Summary | |
---|---|
void |
activate(boolean active)
activates/deactivates logging for all messages. |
void |
activate(Logging.Semantics... semantics)
activates logging only for messages with the given semantics, and errors and warnings. |
void |
activateInfo(boolean active)
globally activates/deactivates all info-messages, not the error-messages. |
void |
clear()
clears the internal buffer or closes and reopens the file. |
void |
correlation(Logging.Semantics semantics,
Object... objects)
a correlation message. |
void |
entering(Object... objects)
indicates entering a method and prints the objects. |
void |
error(String message,
Logging.Origin origin,
Object... objects)
an error message. |
void |
event(Logging.Semantics semantics,
Object... objects)
an event message with a specific semantics. |
void |
exiting(Object... objects)
indicates exiting a method and prints the objects. |
void |
finalize()
flushes the messages and closes the handler |
void |
flush()
flushes the messages to the output stream. |
String |
getContents()
returns the loggings as string if the handler was set as "BUFFER". |
String |
getName()
returns the name of the logger. |
boolean |
hasContents()
returns true if the buffer is not empty . |
boolean |
hasErrors()
returns true if errors have been logged. |
void |
info(Object... objects)
any kind of unspecific info message. |
void |
installation(Object object)
indicates installation of a module and prints the object. |
boolean |
isActive(Logging.Semantics semantics)
checks whether logging for the messages with the given semantics is active. |
void |
resetFormatter()
resets the formatter. |
void |
setFormatter(Formatter formatter)
allows one to install a user defined formatter. |
void |
setHandler(Handler newHandler,
boolean closable)
allows one to install a user defined handler. |
void |
setHandler(Logging.Destination where,
String filename)
allows one to change the handler. |
void |
warning(String message,
Logging.Origin origin,
Object... objects)
a warning. |
Methods inherited from class Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Logging(J2OManager manager)
manager
- the top-level manager
The default handler is a stream handler which sends all messages to System.out All message classes are activated.
Method Detail |
---|
public String getName()
public void setHandler(Logging.Destination where, String filename) throws IOException
where
- either OUT, ERR of BUFFER or FILE.filename
- is a filename, if necessary.
IOException
- if the file could not be opened.
The handler sends the messages either to System,out, System.err, the given file or to the internal buffer.
public void setHandler(Handler newHandler, boolean closable)
handler
- the custom handlerclosable
- true if the handler must be closed at the end
The old handler is removed. The new handler gets the formatter of the previous handler.
public String getContents()
public boolean hasContents()
public void clear()
public boolean hasErrors()
public void setFormatter(Formatter formatter)
public void resetFormatter()
public boolean isActive(Logging.Semantics semantics)
public void activate(Logging.Semantics... semantics)
public final void activate(boolean active)
public void activateInfo(boolean active)
public void flush()
public void entering(Object... objects)
public void exiting(Object... objects)
public void installation(Object object)
public void info(Object... objects)
public void error(String message, Logging.Origin origin, Object... objects)
public void event(Logging.Semantics semantics, Object... objects)
public void warning(String message, Logging.Origin origin, Object... objects)
public void correlation(Logging.Semantics semantics, Object... objects)
public void finalize()
finalize
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |