Initialize logger with real name of implementing class.
[sonitus.git] / src / main / java / net / pterodactylus / sonitus / data / filter / ExternalFilter.java
index c3ab508..5106cf2 100644 (file)
@@ -46,7 +46,7 @@ import com.google.common.io.ByteStreams;
 public abstract class ExternalFilter implements Filter {
 
        /** The logger. */
-       private static final Logger logger = Logger.getLogger(ExternalFilter.class.getName());
+       private final Logger logger = Logger.getLogger(getClass().getName());
 
        /** The format of the source. */
        private Format format;
@@ -115,6 +115,14 @@ public abstract class ExternalFilter implements Filter {
                                @Override
                                protected void feed(byte[] buffer) throws IOException {
                                        processInput.write(buffer);
+                                       processInput.flush();
+                               }
+
+                               @Override
+                               protected void finish() throws IOException {
+                                       processInput.close();
+                                       processOutput.close();
+                                       processError.close();
                                }
                        }).start();
                } catch (IOException ioe1) {