diff --git a/java_console/autotest/src/com/rusefi/RealHwTest.java b/java_console/autotest/src/com/rusefi/RealHwTest.java index 2f72d3cc32..74be54ae22 100644 --- a/java_console/autotest/src/com/rusefi/RealHwTest.java +++ b/java_console/autotest/src/com/rusefi/RealHwTest.java @@ -1,11 +1,14 @@ package com.rusefi; +import com.devexperts.logging.Logging; +import com.rusefi.autodetect.PortDetector; import com.rusefi.io.LinkManager; import org.jetbrains.annotations.NotNull; import java.io.PrintWriter; import java.io.StringWriter; +import static com.devexperts.logging.Logging.getLogging; import static com.rusefi.Timeouts.SECOND; /** @@ -14,18 +17,19 @@ import static com.rusefi.Timeouts.SECOND; * 2/22/2015 */ public class RealHwTest { + private static final Logging log = getLogging(RealHwTest.class); private static final int STARTUP_SLEEP = 20; public static void main(String[] args) throws InterruptedException { - System.out.println("Sleeping " + STARTUP_SLEEP + " seconds to give OS time to connect VCP driver"); + log.info("Sleeping " + STARTUP_SLEEP + " seconds to give OS time to connect VCP driver"); Thread.sleep(STARTUP_SLEEP * SECOND); boolean isSuccess = runHardwareTest(args); if (!isSuccess) System.exit(-1); - FileLog.MAIN.logLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); - FileLog.MAIN.logLine("++++++++++++++++++++++++++++++++++++ Real Hardware Test Passed +++++++++++++++"); - FileLog.MAIN.logLine("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + log.info("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); + log.info("++++++++++++++++++++++++++++++++++++ Real Hardware Test Passed +++++++++++++++"); + log.info("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"); System.exit(0); // this is a safer method eliminating the issue of non-daemon threads } @@ -52,12 +56,12 @@ public class RealHwTest { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); - FileLog.MAIN.logLine("Test failed: " + e + " at " + sw); + log.info("Test failed: " + e + " at " + sw); e.printStackTrace(); return false; } long time = (System.currentTimeMillis() - start) / 1000; - FileLog.MAIN.logLine("Done in " + time + "secs"); + log.info("Done in " + time + "secs"); return true; } @@ -72,8 +76,7 @@ public class RealHwTest { if (args.length == 1 || args.length == 2) { port = args[0]; } else if (args.length == 0) { - // todo: reuse 'PortDetector.autoDetectPort' here? - port = LinkManager.getDefaultPort(); + port = PortDetector.autoDetectPort(null); } else { System.out.println("Only one optional argument expected: port number"); port = null;