| .. | .. |
|---|
| 21 | 21 | */ |
|---|
| 22 | 22 | public class HWInfo { |
|---|
| 23 | 23 | |
|---|
| 24 | | - private static final Logger log = LogManager.getLogger(HWInfo.class); |
|---|
| 24 | + private static final Logger LOG = LogManager.getLogger(HWInfo.class); |
|---|
| 25 | 25 | |
|---|
| 26 | 26 | public static String getOsName() { |
|---|
| 27 | 27 | return System.getProperty("os.name"); |
|---|
| .. | .. |
|---|
| 47 | 47 | for (NetworkInterface network : Collections.list(NetworkInterface.getNetworkInterfaces())) { |
|---|
| 48 | 48 | if (!network.isLoopback() && !network.isVirtual() && !network.isPointToPoint() && network.getHardwareAddress() != null) { |
|---|
| 49 | 49 | macs.add(network.getHardwareAddress()); |
|---|
| 50 | | - log.debug("Interface added {}, MAC: {}", network.getName(), network.getHardwareAddress()); |
|---|
| 50 | + LOG.debug("Interface added {}, MAC: {}", network.getName(), network.getHardwareAddress()); |
|---|
| 51 | 51 | logInterface(network); |
|---|
| 52 | 52 | } |
|---|
| 53 | 53 | } |
|---|
| .. | .. |
|---|
| 57 | 57 | NetworkInterface network = NetworkInterface.getByInetAddress(InetAddress.getLocalHost()); |
|---|
| 58 | 58 | if (network.getHardwareAddress() != null) |
|---|
| 59 | 59 | macs.add(network.getHardwareAddress()); |
|---|
| 60 | | - log.debug("Selected interface (Inet Address rule)"); |
|---|
| 60 | + LOG.debug("Selected interface (Inet Address rule)"); |
|---|
| 61 | 61 | logInterface(network); |
|---|
| 62 | 62 | } |
|---|
| 63 | 63 | |
|---|
| .. | .. |
|---|
| 67 | 67 | if (!network.isLoopback() && !network.isVirtual() && !network.isPointToPoint() && network.getHardwareAddress() != null) { |
|---|
| 68 | 68 | if (network.getHardwareAddress() != null) |
|---|
| 69 | 69 | macs.add(network.getHardwareAddress()); |
|---|
| 70 | | - log.debug("Selected interface (Any with MAC rule)"); |
|---|
| 70 | + LOG.debug("Selected interface (Any with MAC rule)"); |
|---|
| 71 | 71 | logInterface(network); |
|---|
| 72 | 72 | break; |
|---|
| 73 | 73 | } |
|---|
| .. | .. |
|---|
| 81 | 81 | for (byte[] mac : macs) { |
|---|
| 82 | 82 | macAddresses.add(printMacAddress(mac)); |
|---|
| 83 | 83 | } |
|---|
| 84 | | - log.debug("MAC Addresses: {}", macAddresses); |
|---|
| 84 | + LOG.debug("MAC Addresses: {}", macAddresses); |
|---|
| 85 | 85 | return macAddresses; |
|---|
| 86 | 86 | |
|---|
| 87 | 87 | } catch (UnknownHostException e) { |
|---|
| .. | .. |
|---|
| 103 | 103 | } |
|---|
| 104 | 104 | |
|---|
| 105 | 105 | private static void logInterface(NetworkInterface network) { |
|---|
| 106 | | - log.debug("Interface name: {}", network.getName()); |
|---|
| 107 | | - log.debug("Interface display name: {}", network.getDisplayName()); |
|---|
| 106 | + LOG.debug("Interface name: {}", network.getName()); |
|---|
| 107 | + LOG.debug("Interface display name: {}", network.getDisplayName()); |
|---|
| 108 | 108 | try { |
|---|
| 109 | | - log.debug("Interface mac: {}", printMacAddress(network.getHardwareAddress())); |
|---|
| 109 | + LOG.debug("Interface mac: {}", printMacAddress(network.getHardwareAddress())); |
|---|
| 110 | 110 | } catch (SocketException e) { |
|---|
| 111 | 111 | // Silent |
|---|
| 112 | 112 | } |
|---|