Logger¶
-
public class
Logger
¶ A utility class for logging errors. Only has a single instance, which by default sends messages to
System.err
. A different target may be provided usingopen(String)
oropen(OutputStream)
.Author: Tim
Methods¶
close¶
-
public void
close
()¶ Closes the currently opened file or stream and reverts to logging to
System.err
.
open¶
open¶
-
public boolean
open
(OutputStream stream)¶ Attempts to redirect messages to an output stream.
Parameters: - stream –
- the name of the stream to which to send messages
Returns: whether the stream was successfully opened
- stream –
recordMessage¶
-
public void
recordMessage
(String message, MessageLevel level)¶ Records a message to the currently opened stream or file.
Parameters: - message –
- level –
- the level of urgency of the message