From e4e22433d369bd0afda99cf7fe2b3d59d33b7ed5 Mon Sep 17 00:00:00 2001 From: Logan Drescher Date: Mon, 20 Nov 2023 09:07:02 -0500 Subject: [PATCH] Added headless property set --- .../java/org/vcell/cli/CLIStandalone.java | 2 +- .../org/vcell/cli/run/ExecuteCommand.java | 22 ++++++++++++++----- .../java/org/vcell/util/VCellUtilityHub.java | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/vcell-cli/src/main/java/org/vcell/cli/CLIStandalone.java b/vcell-cli/src/main/java/org/vcell/cli/CLIStandalone.java index ea54c9eee9..0059febcf0 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/CLIStandalone.java +++ b/vcell-cli/src/main/java/org/vcell/cli/CLIStandalone.java @@ -66,7 +66,7 @@ static class UserTypeConverter implements CommandLine.ITypeConverter { public User convert(String userString) { // expecting "userid:key" format String[] tokens = userString.split(":"); - if (tokens == null || tokens.length != 2){ + if (tokens.length != 2){ throw new RuntimeException("'"+userString+"' not in 'userid:userkey' format"); } String userid = tokens[0]; diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/ExecuteCommand.java b/vcell-cli/src/main/java/org/vcell/cli/run/ExecuteCommand.java index 34be77a956..48043cc877 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/ExecuteCommand.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/ExecuteCommand.java @@ -58,14 +58,15 @@ public class ExecuteCommand implements Callable { public Integer call() { - CLIRecorder cliLogger = null; + CLIRecorder cliLogger; try { - - Level logLevel = logger.getLevel(); + Level logLevel; if (!bQuiet && bDebug) { logLevel = Level.DEBUG; } else if (bQuiet) { logLevel = Level.OFF; + } else { + logLevel = logger.getLevel(); } // CLILogger will throw an exception if our output dir isn't valid. @@ -80,9 +81,18 @@ public Integer call() { logger.debug("Execution mode requested"); String trace_args = String.format( - "Arguments:\nInput\t: \"%s\"\nOutput\t: \"%s\"\nWriteLogs\t: %b\n" + - "KeepTemp\t: %b\nExactMatch\t: %b\nEncapOut\t: %b\nTimeout\t: %dms\n" + - "Help\t: %b\nDebug\t: %b\nQuiet\t: %b", + """ + Arguments: + Input\t: "%s" + Output\t: "%s" + WriteLogs\t: %b + KeepTemp\t: %b + ExactMatch\t: %b + EncapsulateOut\t: %b + Timeout\t: %dms + Help\t: %b + Debug\t: %b + Quiet\t: %b""", inputFilePath.getAbsolutePath(), outputFilePath.getAbsolutePath(), bWriteLogFiles, bKeepTempFiles, bExactMatchOnly, bEncapsulateOutput, EXECUTABLE_MAX_WALLCLOCK_MILLIS, help, bDebug, bQuiet diff --git a/vcell-util/src/main/java/org/vcell/util/VCellUtilityHub.java b/vcell-util/src/main/java/org/vcell/util/VCellUtilityHub.java index 8a2788185a..2af5eecf95 100644 --- a/vcell-util/src/main/java/org/vcell/util/VCellUtilityHub.java +++ b/vcell-util/src/main/java/org/vcell/util/VCellUtilityHub.java @@ -86,6 +86,7 @@ private VCellUtilityHub(MODE m){ private void startVCellCLI(){ VCellUtilityHub.logManager = CLIRecordManager.getInstance(); + System.setProperty("java.awt.headless", "true"); } private void startVCellStandard(){