import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Utility class containing the common utility functions needed
* for operating on networking data structures
*
*/
public abstract class NetUtils {
+ protected static final Logger logger = LoggerFactory
+ .getLogger(NetUtils.class);
/**
* Constant holding the number of bits in a byte
*/
try {
ip = InetAddress.getByAddress(NetUtils.intToByteArray4(address));
} catch (UnknownHostException e) {
- e.printStackTrace();
+ logger.error("",e);
}
return ip;
}
try {
return InetAddress.getByAddress(address);
} catch (UnknownHostException e) {
- e.printStackTrace();
+ logger.error("",e);
}
return null;
}
try {
address = InetAddress.getByName(addressString);
} catch (UnknownHostException e) {
- e.printStackTrace();
+ logger.error("",e);
}
return address;
}