diff options
Diffstat (limited to 'tools/model-generator')
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Application.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Application.java index 236750310..b6c6b774c 100644 --- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Application.java +++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Application.java @@ -26,6 +26,8 @@ import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.tools.common.CliOptions; import org.onap.policy.apex.tools.common.CliParser; import org.onap.policy.apex.tools.common.OutputFile; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Process an Apex Policy Model file to generate the CLI commands to generate an equivalent Apex Policy Model. @@ -33,6 +35,8 @@ import org.onap.policy.apex.tools.common.OutputFile; * @author Sven van der Meer <sven.van.der.meer@ericsson.com> */ public final class Application { + // Get a reference to the logger + private static final Logger LOGGER = LoggerFactory.getLogger(Application.class); /** The name of the application. */ public static final String APP_NAME = "gen-model2cli"; @@ -118,7 +122,9 @@ public final class Application { final Model2Cli app = new Model2Cli(modelFile, outfile, !cmd.hasOption("sv"), APP_NAME); app.runApp(); } catch (final ApexException aex) { - System.err.println(APP_NAME + ": caught APEX exception with message: " + aex.getMessage()); + String message = APP_NAME + ": caught APEX exception with message: " + aex.getMessage(); + System.err.println(message); + LOGGER.warn(message, aex); } } } diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Application.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Application.java index 2bc70f69e..9735293cf 100644 --- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Application.java +++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Application.java @@ -25,6 +25,8 @@ import org.apache.commons.cli.HelpFormatter; import org.onap.policy.apex.model.basicmodel.concepts.ApexException; import org.onap.policy.apex.tools.common.CliOptions; import org.onap.policy.apex.tools.common.CliParser; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Model 2 event generator with main method. @@ -32,6 +34,8 @@ import org.onap.policy.apex.tools.common.CliParser; * @author Sven van der Meer (sven.van.der.meer@ericsson.com) */ public final class Application { + // Get a reference to the logger + private static final Logger LOGGER = LoggerFactory.getLogger(Application.class); /** The name of the application. */ public static final String APP_NAME = "gen-model2event"; @@ -105,7 +109,9 @@ public final class Application { final Model2JsonEventSchema app = new Model2JsonEventSchema(modelFile, type, APP_NAME); app.runApp(); } catch (final ApexException aex) { - System.err.println(APP_NAME + ": caught APEX exception with message: " + aex.getMessage()); + String message = APP_NAME + ": caught APEX exception with message: " + aex.getMessage(); + System.err.println(message); + LOGGER.warn(message, aex); } } } |