ec.util
Interface IOutput

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
LoggerOutput, Output

public interface IOutput
extends java.io.Serializable


Field Summary
static int ALL_LOGS
           
static int V_NO_ERRORS
          Don't print warnings, messages, or simple errors
static int V_NO_GENERAL
          The standard verbosity to use if you don't want common reporting (like statistics)
static int V_NO_MESSAGES
          Don't print messages
static int V_NO_WARNINGS
          Don't print warnings or messages
static int V_TOTALLY_SILENT
          No verbosity at all, not even system messages or fatal errors
static int V_VERBOSE
          Total verbosity
 
Method Summary
 int addLog(java.io.File filename, int _verbosity, boolean postAnnouncements, boolean appendOnRestart)
          Creates a new log of minimal verbosity verbosity and adds it to Output.
 int addLog(java.io.File filename, int _verbosity, boolean postAnnouncements, boolean appendOnRestart, boolean gzip)
          Creates a new log of minimal verbosity verbosity and adds it to Output.
 int addLog(int descriptor, int _verbosity, boolean postAnnouncements)
          Creates a new log of minimal verbosity verbosity and adds it to Output.
 void clearAnnouncements()
          Clears out announcements.
 void clearErrors()
          Clears the error flag.
 void close()
          Closes the logs -- ONLY call this if you are preparing to quit
 void error(java.lang.String s)
          Posts a simple error.
 void error(java.lang.String s, Parameter p1)
          Posts a simple error.
 void error(java.lang.String s, Parameter p1, Parameter p2)
          Posts a simple error.
 void exitIfErrors()
          Exits with a fatal error if the error flag has been raised.
 void fatal(java.lang.String s)
          Posts a fatal error.
 void fatal(java.lang.String s, Parameter p1)
          Posts a fatal error.
 void fatal(java.lang.String s, Parameter p1, Parameter p2)
          Posts a fatal error.
 void flush()
          Flushes the logs
 int getVerbosity()
          Returns the Output object's general verbosity
 void message(java.lang.String s)
          Posts a message.
 void print(java.lang.String s, int _verbosity, int log)
          Prints a non-announcement message to a given log, with a certain verbosity.
 void print(java.lang.String s, int _verbosity, int[] _logs)
          Prints a non-announcement message to the given logs, with a certain verbosity.
 void println(java.lang.String s, int _verbosity, int log)
          Prints a non-announcement message to the given logs, with a certain verbosity.
 void println(java.lang.String s, int _verbosity, int[] _logs)
          Prints a non-announcement message to the given logs, with a certain verbosity.
 void println(java.lang.String s, int _verbosity, int log, boolean _announcement)
          Prints a message to a given log, with a certain verbosity.
 void restart()
           
 void setFilePrefix(java.lang.String filePrefix)
           
 boolean setFlush(boolean v)
          Sets whether the Output flushes its announcements.
 int setVerbosity(int v)
          Sets the Output object's general verbosity to v.
 void systemMessage(java.lang.String s)
          Posts a system message.
 void warning(java.lang.String s)
          Posts a warning.
 void warning(java.lang.String s, Parameter p1)
          Posts a warning.
 void warning(java.lang.String s, Parameter p1, Parameter p2)
          Posts a warning.
 void warnOnce(java.lang.String s)
          Posts a warning one time only.
 void warnOnce(java.lang.String s, Parameter p1)
           
 void warnOnce(java.lang.String s, Parameter p1, Parameter p2)
           
 

Field Detail

ALL_LOGS

static final int ALL_LOGS
See Also:
Constant Field Values

V_VERBOSE

static final int V_VERBOSE
Total verbosity

See Also:
Constant Field Values

V_NO_MESSAGES

static final int V_NO_MESSAGES
Don't print messages

See Also:
Constant Field Values

V_NO_WARNINGS

static final int V_NO_WARNINGS
Don't print warnings or messages

See Also:
Constant Field Values

V_NO_GENERAL

static final int V_NO_GENERAL
The standard verbosity to use if you don't want common reporting (like statistics)

See Also:
Constant Field Values

V_NO_ERRORS

static final int V_NO_ERRORS
Don't print warnings, messages, or simple errors

See Also:
Constant Field Values

V_TOTALLY_SILENT

static final int V_TOTALLY_SILENT
No verbosity at all, not even system messages or fatal errors

See Also:
Constant Field Values
Method Detail

close

void close()
Closes the logs -- ONLY call this if you are preparing to quit


flush

void flush()
Flushes the logs


setFlush

boolean setFlush(boolean v)
Sets whether the Output flushes its announcements.


setVerbosity

int setVerbosity(int v)
Sets the Output object's general verbosity to v.


getVerbosity

int getVerbosity()
Returns the Output object's general verbosity


setFilePrefix

void setFilePrefix(java.lang.String filePrefix)

addLog

int addLog(java.io.File filename,
           int _verbosity,
           boolean postAnnouncements,
           boolean appendOnRestart,
           boolean gzip)
           throws java.io.IOException
Creates a new log of minimal verbosity verbosity and adds it to Output. This log will write to the file filename, and may or may not post announcements to the log. If the log must be reset upon restarting from a checkpoint, it will append to the file or erase the file and start over depending on appendOnRestart. If appendOnRestart is false and postAnnouncements is true, then this log will repost all the announcements on restarting from a checkpoint. Returns the position of the log in Output's collection of logs -- you should use this to access the log always; never store the log itself, which may go away upon a system restart. The log can be compressed with gzip, but you cannot appendOnRestart and compress at the same time.

Throws:
java.io.IOException

addLog

int addLog(java.io.File filename,
           int _verbosity,
           boolean postAnnouncements,
           boolean appendOnRestart)
           throws java.io.IOException
Creates a new log of minimal verbosity verbosity and adds it to Output. This log will write to the file filename, and may or may not post announcements to the log. If the log must be reset upon restarting from a checkpoint, it will append to the file or erase the file and start over depending on appendOnRestart. If appendOnRestart is false and postAnnouncements is true, then this log will repost all the announcements on restarting from a checkpoint. Returns the position of the log in Output's collection of logs -- you should use this to access the log always; never store the log itself, which may go away upon a system restart.

Throws:
java.io.IOException

addLog

int addLog(int descriptor,
           int _verbosity,
           boolean postAnnouncements)
Creates a new log of minimal verbosity verbosity and adds it to Output. This log will write to stdout (descriptor == Log.D_STDOUT) or stderr (descriptor == Log.D_STDERR), and may or may not post announcements to the log. Returns the position of the log in Output's collection of logs -- you should use this to access the log always; never store the log itself, which may go away upon a system restart.


systemMessage

void systemMessage(java.lang.String s)
Posts a system message.


fatal

void fatal(java.lang.String s)
Posts a fatal error. This causes the system to exit.


fatal

void fatal(java.lang.String s,
           Parameter p1)
Posts a fatal error. This causes the system to exit.


fatal

void fatal(java.lang.String s,
           Parameter p1,
           Parameter p2)
Posts a fatal error. This causes the system to exit.


error

void error(java.lang.String s)
Posts a simple error. This causes the error flag to be raised as well.


error

void error(java.lang.String s,
           Parameter p1)
Posts a simple error. This causes the error flag to be raised as well.


error

void error(java.lang.String s,
           Parameter p1,
           Parameter p2)
Posts a simple error. This causes the error flag to be raised as well.


warning

void warning(java.lang.String s,
             Parameter p1,
             Parameter p2)
Posts a warning.


warning

void warning(java.lang.String s,
             Parameter p1)
Posts a warning.


warning

void warning(java.lang.String s)
Posts a warning.


warnOnce

void warnOnce(java.lang.String s)
Posts a warning one time only.


warnOnce

void warnOnce(java.lang.String s,
              Parameter p1)

warnOnce

void warnOnce(java.lang.String s,
              Parameter p1,
              Parameter p2)

message

void message(java.lang.String s)
Posts a message.


println

void println(java.lang.String s,
             int _verbosity,
             int log,
             boolean _announcement)
             throws OutputException
Prints a message to a given log, with a certain verbosity. If log==ALL_LOGS, posted to all logs.

Throws:
OutputException

println

void println(java.lang.String s,
             int _verbosity,
             int[] _logs)
             throws OutputException
Prints a non-announcement message to the given logs, with a certain verbosity.

Throws:
OutputException

println

void println(java.lang.String s,
             int _verbosity,
             int log)
             throws OutputException
Prints a non-announcement message to the given logs, with a certain verbosity.

Throws:
OutputException

print

void print(java.lang.String s,
           int _verbosity,
           int log)
           throws OutputException
Prints a non-announcement message to a given log, with a certain verbosity. If log==ALL_LOGS, posted to all logs. No '\n' is printed.

Throws:
OutputException

print

void print(java.lang.String s,
           int _verbosity,
           int[] _logs)
           throws OutputException
Prints a non-announcement message to the given logs, with a certain verbosity. No '\n' is printed.

Throws:
OutputException

exitIfErrors

void exitIfErrors()
Exits with a fatal error if the error flag has been raised.


clearErrors

void clearErrors()
Clears the error flag.


clearAnnouncements

void clearAnnouncements()
Clears out announcements. Note that this will cause these announcements to be unavailable for reposting after a restart!


restart

void restart()
             throws java.io.IOException
Throws:
java.io.IOException