[cooja] PcapExporter: Use logger
Removed unnused imports, replaced println and printStackTrace by logger
This commit is contained in:
parent
95b54f415e
commit
373b00fc47
|
@ -1,13 +1,13 @@
|
||||||
package org.contikios.cooja.plugins.analyzers;
|
package org.contikios.cooja.plugins.analyzers;
|
||||||
|
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
public class PcapExporter {
|
public class PcapExporter {
|
||||||
|
private static final Logger logger = Logger.getLogger(PcapExporter.class);
|
||||||
|
|
||||||
DataOutputStream out;
|
DataOutputStream out;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public class PcapExporter {
|
||||||
out.writeInt(195); /* 195 for LINKTYPE_IEEE802_15_4 */
|
out.writeInt(195); /* 195 for LINKTYPE_IEEE802_15_4 */
|
||||||
|
|
||||||
out.flush();
|
out.flush();
|
||||||
System.out.println("Opened pcap file " + pcapFile);
|
logger.info("Opened pcap file " + pcapFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closePcap() throws IOException {
|
public void closePcap() throws IOException {
|
||||||
|
@ -56,7 +56,7 @@ public class PcapExporter {
|
||||||
out.write(data);
|
out.write(data);
|
||||||
out.flush();
|
out.flush();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue