[cooja] IEEE802154Analyzer: Use logger

Replaced println and printStackTrace by logger
This commit is contained in:
Enrico Joerns 2014-10-02 01:37:24 +02:00
parent 373b00fc47
commit c5e034fa1a

View File

@ -2,11 +2,14 @@ package org.contikios.cooja.plugins.analyzers;
import java.io.IOException; import java.io.IOException;
import java.io.File; import java.io.File;
import org.apache.log4j.Logger;
import org.contikios.cooja.util.StringUtils; import org.contikios.cooja.util.StringUtils;
public class IEEE802154Analyzer extends PacketAnalyzer { public class IEEE802154Analyzer extends PacketAnalyzer {
private static final Logger logger = Logger.getLogger(IEEE802154Analyzer.class);
// Addressing modes // Addressing modes
public static final int NO_ADDRESS = 0; public static final int NO_ADDRESS = 0;
public static final int RSV_ADDRESS = 1; public static final int RSV_ADDRESS = 1;
@ -33,7 +36,7 @@ public class IEEE802154Analyzer extends PacketAnalyzer {
try { try {
pcapExporter = new PcapExporter(); pcapExporter = new PcapExporter();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); logger.error(e);
} }
} }
} }
@ -43,8 +46,7 @@ public class IEEE802154Analyzer extends PacketAnalyzer {
try { try {
pcapExporter.openPcap(pcapFile); pcapExporter.openPcap(pcapFile);
} catch (IOException e) { } catch (IOException e) {
System.err.println("Could not open pcap file"); logger.error("Could not open pcap file", e);
e.printStackTrace();
} }
} }
} }
@ -69,8 +71,7 @@ public class IEEE802154Analyzer extends PacketAnalyzer {
try { try {
pcapExporter.exportPacketData(packet.getPayload()); pcapExporter.exportPacketData(packet.getPayload());
} catch (IOException e) { } catch (IOException e) {
System.err.println("Could not export PCap data"); logger.error("Could not export PCap data", e);
e.printStackTrace();
} }
} }