Log.java: use Packet.toString()
authorAdam Megacz <adam@megacz.com>
Sun, 30 Aug 2009 00:10:26 +0000 (17:10 -0700)
committerAdam Megacz <adam@megacz.com>
Sun, 30 Aug 2009 00:10:26 +0000 (17:10 -0700)
src/edu/berkeley/fleet/interpreter/Log.java

index 914e524..e9237a2 100644 (file)
@@ -24,25 +24,7 @@ public class Log {
     }
 
     public static void packet(Packet p) {
-        BitVector data = p.getValue();
-        Dock source = p.getSource();
-        Destination dest = p.getDestination();
-        if (dest.getDock().getInstructionDestination()==dest) {
-            if (p.isToken()) {
-                println(ANSI.yellow(ANSI.bold("  torpedo: ")) + (source + " -> " + ANSI.yellow(ANSI.bold(dest+""))));
-            } else {
-                Instruction d = source.getShip().getFleet().decodeInstruction(data, source);
-                println(ANSI.red("dispatch: " + indent(d+"", "          ")));
-            }
-        } else {
-            if (p.isToken()) {
-                println(ANSI.blue(ANSI.bold("   token: ")) + (source + " -> " + ANSI.blue(ANSI.bold(dest+""))));
-            } else {
-                println(indent(ANSI.cyan("    data: "+data) +
-                               (source==null ? "" :
-                                (" : " + source))+(" -> "+ANSI.cyan(""+dest)), "          "));
-            }
-        }
+        println(p.toString());
     }
 
     public static void error(Object o) { println(ANSI.red(o)); }