From c5e034fa1a2740e1d03cf75df4d2d5f713dcf66d Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Thu, 2 Oct 2014 01:37:24 +0200 Subject: [PATCH] [cooja] IEEE802154Analyzer: Use logger Replaced println and printStackTrace by logger --- .../cooja/plugins/analyzers/IEEE802154Analyzer.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/cooja/java/org/contikios/cooja/plugins/analyzers/IEEE802154Analyzer.java b/tools/cooja/java/org/contikios/cooja/plugins/analyzers/IEEE802154Analyzer.java index 74408b363..29e29262b 100644 --- a/tools/cooja/java/org/contikios/cooja/plugins/analyzers/IEEE802154Analyzer.java +++ b/tools/cooja/java/org/contikios/cooja/plugins/analyzers/IEEE802154Analyzer.java @@ -2,11 +2,14 @@ package org.contikios.cooja.plugins.analyzers; import java.io.IOException; import java.io.File; +import org.apache.log4j.Logger; import org.contikios.cooja.util.StringUtils; public class IEEE802154Analyzer extends PacketAnalyzer { + private static final Logger logger = Logger.getLogger(IEEE802154Analyzer.class); + // Addressing modes public static final int NO_ADDRESS = 0; public static final int RSV_ADDRESS = 1; @@ -33,7 +36,7 @@ public class IEEE802154Analyzer extends PacketAnalyzer { try { pcapExporter = new PcapExporter(); } catch (IOException e) { - e.printStackTrace(); + logger.error(e); } } } @@ -43,8 +46,7 @@ public class IEEE802154Analyzer extends PacketAnalyzer { try { pcapExporter.openPcap(pcapFile); } catch (IOException e) { - System.err.println("Could not open pcap file"); - e.printStackTrace(); + logger.error("Could not open pcap file", e); } } } @@ -69,8 +71,7 @@ public class IEEE802154Analyzer extends PacketAnalyzer { try { pcapExporter.exportPacketData(packet.getPayload()); } catch (IOException e) { - System.err.println("Could not export PCap data"); - e.printStackTrace(); + logger.error("Could not export PCap data", e); } }