From a9d3ce22b58c250a83f0b232b66ae5f14ef59eee Mon Sep 17 00:00:00 2001 From: saledouble Date: Wed, 6 Nov 2019 12:58:09 -0500 Subject: [PATCH] Rejuvenate log levels --- src/deviation/DeviationUploader.java | 4 ++-- src/deviation/Dfu.java | 10 +++++----- src/deviation/TxInfo.java | 2 +- src/deviation/filesystem/FlashIO.java | 2 +- src/deviation/filesystem/TxInterfaceCommon.java | 6 +++--- src/deviation/gui/MonitorUSB.java | 4 ++-- src/deviation/gui/TextEditor.java | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/deviation/DeviationUploader.java b/src/deviation/DeviationUploader.java index bcad942..73166ca 100644 --- a/src/deviation/DeviationUploader.java +++ b/src/deviation/DeviationUploader.java @@ -167,12 +167,12 @@ private static void readBinFromDevice(DfuDevice dev, String fname, int address, private static void listDevices(List devs) { if (devs.size() == 0) { - LOG.info("No devices found."); + LOG.finer("No devices found."); } else { LOG.info(String.format("Device\t%9s %8s %8s %7s %s", "Interface", "Start", "End", "Size", "Count")); for (DfuDevice dev: devs) { int i = 0; - LOG.info(String.format("%s", dev.getTxInfo().type().getName())); + LOG.finer(String.format("%s", dev.getTxInfo().type().getName())); for (DfuInterface iface: dev.Interfaces()) { for (SegmentParser segment: iface.Memory().segments()) { for (Sector sector: segment.sectors()) { diff --git a/src/deviation/Dfu.java b/src/deviation/Dfu.java index 081600c..4dd3c08 100644 --- a/src/deviation/Dfu.java +++ b/src/deviation/Dfu.java @@ -113,7 +113,7 @@ public static int dfuseSpecialCommand(DfuDevice dev, long address, int command) address & ~(sector.size() - 1))); buf[0] = 0x41; // Erase command } else if (command == DFUSE_SET_ADDRESS) { - LOG.info(String.format("Setting address pointer to 0x%x", address)); + LOG.fine(String.format("Setting address pointer to 0x%x", address)); buf[0] = 0x21; /* Set Address Pointer command */ } else { LOG.severe(String.format("Error: Non-supported special command %d", command)); @@ -313,7 +313,7 @@ public static int setIdle(DfuDevice dev) LOG.severe("Device still in Runtime Mode!"); return -1; case DfuStatus.STATE_DFU_ERROR: - LOG.fine("dfuERROR, clearing status"); + LOG.info("dfuERROR, clearing status"); if (clearStatus(dev) < 0) { LOG.severe("error clear_status"); return -1; @@ -358,7 +358,7 @@ public static int setIdle(DfuDevice dev) /* Boot loader decides the start address, unknown to us */ /* Use a short length to lower risk of running out of bounds */ - LOG.fine(String.format("bytes_per_hash=%d", xfer_size)); + LOG.finer(String.format("bytes_per_hash=%d", xfer_size)); LOG.info("Starting device read"); ByteArrayOutputStream data = new ByteArrayOutputStream(); @@ -393,7 +393,7 @@ public static int sendToDevice(DfuDevice dev, long address, byte[] data, Progre setIdle(dev); while (true) { Sector sector = dev.Memory().find(sector_address); - LOG.info(String.format("%d: %d (%d)", sector_address, sector == null ? -1 : sector.end(), address + data.length)); + LOG.fine(String.format("%d: %d (%d)", sector_address, sector == null ? -1 : sector.end(), address + data.length)); if (sector == null || ! sector.writable()) { LOG.severe(String.format("Error: No sector found that can be written at address 0x%08x", sector_address)); return -1; @@ -497,7 +497,7 @@ public static int resetSTM32(DfuDevice dev) { if( status.bState != DfuStatus.STATE_DFU_MANIFEST) { LOG.severe("Error: Expected STM32 to be in dfuMANIFEST state after get-status command!"); } else { - LOG.info("Successfully reset STM32"); + LOG.fine("Successfully reset STM32"); } return 0; } diff --git a/src/deviation/TxInfo.java b/src/deviation/TxInfo.java index 32351ba..965a5fe 100644 --- a/src/deviation/TxInfo.java +++ b/src/deviation/TxInfo.java @@ -28,7 +28,7 @@ public TxInfo(byte [] data) int j; for (j = 0; j < 32 && data[j] != 0; j++) { } model = new String(Arrays.copyOfRange(data, 0, j)); - LOG.info(model); + LOG.fine(model); type = TransmitterList.UNKNOWN(); txloop: for (Transmitter tx : TransmitterList.values()) { diff --git a/src/deviation/filesystem/FlashIO.java b/src/deviation/filesystem/FlashIO.java index f10ab07..2cf0303 100644 --- a/src/deviation/filesystem/FlashIO.java +++ b/src/deviation/filesystem/FlashIO.java @@ -86,7 +86,7 @@ public void close() throws IOException { } } } - public void flush() { LOG.info("flush");} + public void flush() { LOG.finer("flush");} public int getSectorSize() throws IOException { return fsSectorSize; } public long getSize() throws IOException { return ram.length - startOffset; } public boolean isClosed() { return false; } diff --git a/src/deviation/filesystem/TxInterfaceCommon.java b/src/deviation/filesystem/TxInterfaceCommon.java index 1a16d18..25ab252 100644 --- a/src/deviation/filesystem/TxInterfaceCommon.java +++ b/src/deviation/filesystem/TxInterfaceCommon.java @@ -23,11 +23,11 @@ protected static List readDirRecur(String parent, FsDirectory dir) thr if (entry.isDirectory()) { if (entry.getName().equals(".") || entry.getName().equals("..")) continue; - LOG.fine(String.format("DIR: %s", entry.getName())); + LOG.finer(String.format("DIR: %s", entry.getName())); files.addAll(readDirRecur(parent + entry.getName() + "/", entry.getDirectory())); } else { files.add(new FileInfo(parent + entry.getName(), (int)entry.getFile().getLength())); - LOG.fine(String.format("FILE: %s (%d)", entry.getName(), entry.getFile().getLength())); + LOG.finer(String.format("FILE: %s (%d)", entry.getName(), entry.getFile().getLength())); } } return files; @@ -45,7 +45,7 @@ protected void readDir(FileSystem fs, String dirStr) { Iterator itr = dir.iterator(); while(itr.hasNext()) { FsDirectoryEntry entry = itr.next(); - LOG.info(entry.getName()); + LOG.finest(entry.getName()); } } catch (IOException e) { e.printStackTrace(); } } diff --git a/src/deviation/gui/MonitorUSB.java b/src/deviation/gui/MonitorUSB.java index 8df4adc..aa99d83 100644 --- a/src/deviation/gui/MonitorUSB.java +++ b/src/deviation/gui/MonitorUSB.java @@ -59,7 +59,7 @@ public String doInBackground() { if (dfuDev != null) { LibUsb.freeDeviceList(this.devices, true); dfuDev = null; - LOG.info("Unplug detected"); + LOG.finest("Unplug detected"); state_changed = true; //Signal disconnect } @@ -71,7 +71,7 @@ public String doInBackground() { dfuDev = dev; dfuDev.setTxInfo(TxInfo.getTxInfo(dfuDev)); this.devices = devices; - LOG.info("Hotplug detected"); + LOG.finest("Hotplug detected"); state_changed = true; //Signal connect/change } else { diff --git a/src/deviation/gui/TextEditor.java b/src/deviation/gui/TextEditor.java index e967246..162d6ec 100644 --- a/src/deviation/gui/TextEditor.java +++ b/src/deviation/gui/TextEditor.java @@ -73,7 +73,7 @@ public TextEditor(FileInfo file) { textArea.setMarkOccurrences(true); textArea.append(finalData); Font f = textArea.getFont(); - LOG.info(String.format("Font: %d", f.getSize())); + LOG.finest(String.format("Font: %d", f.getSize())); f = new Font(f.getFamily(), f.getStyle(), f.getSize()+5); textArea.setFont(f); RTextScrollPane sp = new RTextScrollPane(textArea);