예제 #1
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a simple error. This causes the error flag to be raised as well. */
 public synchronized void error(String s, Parameter p1, Parameter p2) {
   println("ERROR:\n" + s, ALL_LOGS, true);
   if (p1 != null) println("PARAMETER: " + p1, ALL_LOGS, true);
   if (p2 != null && p1 != null) println("     ALSO: " + p2, ALL_LOGS, true);
   else println("PARAMETER: " + p2, ALL_LOGS, true);
   errors = true;
 }
예제 #2
0
파일: Output.java 프로젝트: pgoelz/xfp
 public synchronized void warnOnce(String s, Parameter p1) {
   if (!oneTimeWarnings.contains(s)) {
     oneTimeWarnings.add(s);
     println("ONCE-ONLY WARNING:\n" + s, ALL_LOGS, true);
     if (p1 != null) println("PARAMETER: " + p1, ALL_LOGS, true);
   }
 }
예제 #3
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a fatal error. This causes the system to exit. */
 public synchronized void fatal(String s, Parameter p1, Parameter p2) {
   println("FATAL ERROR:\n" + s, ALL_LOGS, true);
   if (p1 != null) println("PARAMETER: " + p1, ALL_LOGS, true);
   if (p2 != null && p1 != null) println("     ALSO: " + p2, ALL_LOGS, true);
   else println("PARAMETER: " + p2, ALL_LOGS, true);
   exitWithError();
 }
예제 #4
0
파일: Output.java 프로젝트: pgoelz/xfp
 /**
  * Prints a message to a given log, with a certain verbosity. If log==ALL_LOGS, posted to all logs
  * which accept announcements.
  *
  * @deprecated Verbosity no longer has an effect
  */
 synchronized void println(String s, int _verbosity, int log, boolean _announcement)
     throws OutputException {
   if (log == ALL_LOGS)
     for (int x = 0; x < logs.size(); x++) {
       Log l = (Log) logs.elementAt(x);
       if (l == null) throw new OutputException("Unknown log number" + l);
       println(s, _verbosity, l, _announcement, false);
     }
   else {
     Log l = (Log) logs.elementAt(log);
     if (l == null) throw new OutputException("Unknown log number" + l);
     println(s, _verbosity, l, _announcement, false);
   }
 }
예제 #5
0
파일: Output.java 프로젝트: pgoelz/xfp
  public synchronized void restart() throws IOException {
    // restart logs, then repost announcements to them
    int ls = logs.size();
    for (int x = 0; x < ls; x++) {
      Log l = (Log) (logs.elementAt(x));
      logs.setElementAt(l = l.restarter.restart(l), x);
      if (l.repostAnnouncementsOnRestart && store) {
        int as = announcements.size();
        for (int y = 0; y < as; y++) {
          Announcement a = (Announcement) (announcements.elementAt(y));
          println(a.text, V_VERBOSE, l, true, true);
        }
      }
    }

    // exit with a fatal error if the errors flag is set.
    exitIfErrors();
  }
예제 #6
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Exits with a fatal error if the error flag has been raised. */
 public synchronized void exitIfErrors() {
   if (errors) {
     println("SYSTEM EXITING FROM ERRORS\n", ALL_LOGS, true);
     exitWithError();
   }
 }
예제 #7
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Prints a non-announcement message to the given logs, with a verbosity of V_NO_GENERAL. */
 public synchronized void println(String s, int log) throws OutputException {
   println(s, V_VERBOSE, log);
 }
예제 #8
0
파일: Output.java 프로젝트: pgoelz/xfp
 /**
  * Prints a non-announcement message to the given logs, with a certain verbosity.
  *
  * @deprecated Verbosity no longer has an effect
  */
 public synchronized void println(String s, int _verbosity, int log) throws OutputException {
   println(s, V_VERBOSE, (Log) (logs.elementAt(log)), false, false);
 }
예제 #9
0
파일: Output.java 프로젝트: pgoelz/xfp
 /**
  * Prints a non-announcement message to the given logs, with a certain verbosity.
  *
  * @deprecated Verbosity no longer has an effect
  */
 public synchronized void println(String s, int _verbosity, int[] _logs) throws OutputException {
   for (int x = 0; x < _logs.length; x++)
     println(s, V_VERBOSE, (Log) (logs.elementAt(_logs[x])), false, false);
 }
예제 #10
0
파일: Output.java 프로젝트: pgoelz/xfp
 /**
  * Prints a message to a given log. If log==ALL_LOGS, posted to all logs which accept
  * announcements.
  */
 public synchronized void println(String s, int log, boolean _announcement)
     throws OutputException {
   println(s, V_VERBOSE, log, _announcement);
 }
예제 #11
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a warning one time only. */
 public synchronized void warnOnce(String s) {
   if (!oneTimeWarnings.contains(s)) {
     oneTimeWarnings.add(s);
     println("ONCE-ONLY WARNING:\n" + s, ALL_LOGS, true);
   }
 }
예제 #12
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a warning. */
 public synchronized void warning(String s) {
   println("WARNING:\n" + s, ALL_LOGS, true);
 }
예제 #13
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a warning. */
 public synchronized void warning(String s, Parameter p1) {
   println("WARNING:\n" + s, ALL_LOGS, true);
   if (p1 != null) println("PARAMETER: " + p1, ALL_LOGS, true);
 }
예제 #14
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a simple error. This causes the error flag to be raised as well. */
 public synchronized void error(String s) {
   println("ERROR:\n" + s, ALL_LOGS, true);
   errors = true;
 }
예제 #15
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a fatal error. This causes the system to exit. */
 public synchronized void fatal(String s) {
   println("FATAL ERROR:\n" + s, ALL_LOGS, true);
   exitWithError();
 }
예제 #16
0
파일: Output.java 프로젝트: pgoelz/xfp
 /** Posts a system message. */
 public synchronized void systemMessage(String s) {
   println(s, V_NO_MESSAGES, ALL_LOGS, true);
 }