Create threads with decent names.
[sonitus.git] / src / main / java / net / pterodactylus / sonitus / data / Pipeline.java
index 66ee2e5..063a0bc 100644 (file)
@@ -167,13 +167,15 @@ public class Pipeline implements Iterable<ControlledComponent> {
                        }
                }
                for (Connection connection : connections) {
-                       logger.info(String.format("Starting Connection from %s to %s.", connection.source.name(), FluentIterable.from(connection.sinks).transform(new Function<Sink, String>() {
+                       String threadName = String.format("%s → %s.", connection.source.name(), FluentIterable.from(connection.sinks).transform(new Function<Sink, String>() {
+
                                @Override
                                public String apply(Sink sink) {
                                        return sink.name();
                                }
-                       })));
-                       new Thread(connection).start();
+                       }));
+                       logger.info(String.format("Starting Thread: %s", threadName));
+                       new Thread(connection, threadName).start();
                }
        }