Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.cwru.SimpleRTS.util
Class Logger

    java.lang.Object
      edu.cwru.SimpleRTS.util.Logger

    public class Logger

extends java.lang.Object

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 using `open(String)` or `open(OutputStream)`.

Author:
  Tim

Nested Class Summary
`static class` | `Logger.MessageLevel` A list of different levels of urgency of messages

Method Summary
`void` | `close()` Closes the currently opened file or stream and reverts to logging to `System.err`.
`static Logger` | `getInstance()`
`boolean` | `open(java.io.OutputStream stream)` Attempts to redirect messages to an output stream.
`boolean` | `open(java.lang.String filename)` Attempts to redirect messages to a file.
`void` | `recordMessage(java.lang.String message, Logger.MessageLevel level)` Records a message to the currently opened stream or file.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static Logger getInstance()

### open

    public boolean open(java.lang.String filename)

  Attempts to redirect messages to a file.

  Parameters:
    `filename` - - the name of the file in which to store messages
  Returns:
    whether the file was successfully opened

### open

    public boolean open(java.io.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

### close

    public void close()

  Closes the currently opened file or stream and reverts to logging to `System.err`.

### recordMessage

    public void recordMessage(java.lang.String message,
                              Logger.MessageLevel level)

  Records a message to the currently opened stream or file.

  Parameters:
    `message` -
    `level` - - the level of urgency of the message

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD