fix #232 and #235 logfile dir and config

This commit is contained in:
Jonathan Shook
2020-12-06 16:10:39 -06:00
parent d960f50be1
commit 6248b0e2ab
2 changed files with 17 additions and 1 deletions

View File

@@ -89,8 +89,10 @@ public class NBCLI {
loggerConfig.setConsoleLevel(NBLogLevel.ERROR);
NBCLIOptions globalOptions = new NBCLIOptions(args, NBCLIOptions.Mode.ParseGlobalsOnly);
String sessionName = new SessionNamer().format(globalOptions.getSessionName());
loggerConfig
.setSessionName(sessionName)
.setConsoleLevel(globalOptions.getConsoleLogLevel())
.setConsolePattern(globalOptions.getConsoleLoggingPattern())
.setLogfileLevel(globalOptions.getScenarioLogLevel())
@@ -103,6 +105,7 @@ public class NBCLI {
logger = LogManager.getLogger("NBCLI");
loggerConfig.purgeOldFiles(LogManager.getLogger("SCENARIO"));
logger.info("Configured scenario log at " + loggerConfig.getLogfileLocation());
logger.debug("Scenario log started");
// Global only processing
if (args.length == 0) {
@@ -162,7 +165,6 @@ public class NBCLI {
}
NBCLIOptions options = new NBCLIOptions(args);
String sessionName = new SessionNamer().format(options.getSessionName());
logger = LogManager.getLogger("NBCLI");
NBIO.addGlobalIncludes(options.wantsIncludes());