Пример #1
0
 public synchronized void errorCaught(ProcessHandler processHandler) {
   if (finished) return;
   ensureNewline();
   out.print(inv_red);
   lastMsg = LastMessages.Other;
   out.printf(
       "[     ERROR     ] Process %s causerd error (last command: %s)\n",
       processHandler.toString(), processHandler.getLastCommand().toString());
   out.print(norm);
 }
Пример #2
0
  public synchronized void processStopped(ProcessHandler processHandler) {
    if (processHandler instanceof ReplicaHandler) {
      ensureNewline();
      if (color) out.print(red);
      lastMsg = LastMessages.Other;
      out.println("[Replica stopped] " + processHandler.toString());
    } else if (processHandler instanceof ClientHandler) {
      if (lastMsg != LastMessages.Stop) {
        ensureNewline();
        lastMsg = LastMessages.Stop;
        if (color) out.print(gray);
        out.print("[Client stopped ] " + ((ClientHandler) processHandler).getName());
        out.flush();
      } else {
        out.print(" " + ((ClientHandler) processHandler).getName());
      }

    } else {
      ensureNewline();
      if (color) out.print(red);
      lastMsg = LastMessages.Other;
      out.println("[Unknown stopped] " + processHandler.toString());
    }
  }