Ejemplo n.º 1
0
 /** 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;
 }
Ejemplo n.º 2
0
 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);
   }
 }
Ejemplo n.º 3
0
 /** 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();
 }
Ejemplo n.º 4
0
 /**
  * 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);
   }
 }
Ejemplo n.º 5
0
  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();
  }
Ejemplo n.º 6
0
 /** 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();
   }
 }
Ejemplo n.º 7
0
 /** 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);
 }
Ejemplo n.º 8
0
 /**
  * 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);
 }
Ejemplo n.º 9
0
 /**
  * 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);
 }
Ejemplo n.º 10
0
 /**
  * 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);
 }
Ejemplo n.º 11
0
 /** 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);
   }
 }
Ejemplo n.º 12
0
 /** Posts a warning. */
 public synchronized void warning(String s) {
   println("WARNING:\n" + s, ALL_LOGS, true);
 }
Ejemplo n.º 13
0
 /** 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);
 }
Ejemplo n.º 14
0
 /** 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;
 }
Ejemplo n.º 15
0
 /** 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();
 }
Ejemplo n.º 16
0
 /** Posts a system message. */
 public synchronized void systemMessage(String s) {
   println(s, V_NO_MESSAGES, ALL_LOGS, true);
 }