refactor to use common.utils.logging 08/123208/1
authorTaka Cho <takamune.cho@att.com>
Mon, 9 Aug 2021 21:13:55 +0000 (17:13 -0400)
committerTaka Cho <takamune.cho@att.com>
Mon, 9 Aug 2021 21:15:39 +0000 (17:15 -0400)
using utils.logging from common repo

Issue-ID: POLICY-3087
Change-Id: I60fb7eb47e38ae776f1d23926b551667c555700a
Signed-off-by: Taka Cho <takamune.cho@att.com>
controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java
controlloop/common/feature-controlloop-utils/src/test/java/org/onap/policy/drools/apps/controlloop/feature/utils/ControlLoopUtilsFeatureTest.java
controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Rules.java

index 94aa224..b9caef9 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ import org.junit.Test;
 import org.kie.api.builder.ReleaseId;
 import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
 import org.onap.policy.common.utils.coder.CoderException;
+import org.onap.policy.common.utils.logging.LoggerUtils;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.drools.persistence.SystemPersistenceConstants;
 import org.onap.policy.drools.properties.DroolsPropertyConstants;
@@ -45,7 +46,6 @@ import org.onap.policy.drools.system.PolicyControllerConstants;
 import org.onap.policy.drools.system.PolicyEngine;
 import org.onap.policy.drools.system.PolicyEngineConstants;
 import org.onap.policy.drools.util.KieUtils;
-import org.onap.policy.drools.utils.logging.LoggerUtil;
 import org.onap.policy.simulators.Util;
 
 /**
@@ -94,7 +94,7 @@ public class RestControlLoopManagerTest {
     @BeforeClass
     public static void setUp() throws Exception {
         System.setProperty("kie.maven.settings.custom", "src/test/resources/settings.xml");
-        LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "WARN");
+        LoggerUtils.setLevel(LoggerUtils.ROOT_LOGGER, "WARN");
 
         SystemPersistenceConstants.getManager().setConfigurationDir("src/test/resources");
         PolicyEngineConstants.getManager()
index db0c7a4..069b370 100644 (file)
@@ -24,8 +24,8 @@ import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
 import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.utils.logging.LoggerUtils;
 import org.onap.policy.drools.system.PolicyEngineConstants;
-import org.onap.policy.drools.utils.logging.LoggerUtil;
 import org.onap.policy.simulators.Util;
 
 /**
@@ -35,8 +35,8 @@ public class ControlLoopUtilsFeatureTest {
 
     @Test
     public void testSimulate() {
-        LoggerUtil.setLevel("ROOT", "INFO");
-        LoggerUtil.setLevel("org.eclipse.jetty", "WARN");
+        LoggerUtils.setLevel("ROOT", "INFO");
+        LoggerUtils.setLevel("org.eclipse.jetty", "WARN");
         final ControlLoopUtilsFeature feature = new ControlLoopUtilsFeature();
         feature.afterStart(PolicyEngineConstants.getManager());
         assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.AAISIM_SERVER_PORT));
index 06eab0d..09eb58d 100644 (file)
@@ -48,6 +48,7 @@ import org.kie.api.event.rule.RuleRuntimeEventListener;
 import org.kie.api.runtime.KieSession;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
+import org.onap.policy.common.utils.logging.LoggerUtils;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.controlloop.ControlLoopEvent;
 import org.onap.policy.controlloop.drl.legacy.ControlLoopParams;
@@ -61,7 +62,6 @@ import org.onap.policy.drools.system.PolicyControllerFactory;
 import org.onap.policy.drools.system.PolicyEngine;
 import org.onap.policy.drools.system.PolicyEngineConstants;
 import org.onap.policy.drools.util.KieUtils;
-import org.onap.policy.drools.utils.logging.LoggerUtil;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
 import org.slf4j.Logger;
@@ -257,10 +257,10 @@ public class Rules {
      * Sets up overall logging.
      */
     private void setupLogging() {
-        LoggerUtil.setLevel(LoggerUtil.ROOT_LOGGER, "WARN");
-        LoggerUtil.setLevel("org.eclipse.jetty", "WARN");
-        LoggerUtil.setLevel("org.onap.policy.controlloop", "INFO");
-        LoggerUtil.setLevel("network", "INFO");
+        LoggerUtils.setLevel(LoggerUtils.ROOT_LOGGER, "WARN");
+        LoggerUtils.setLevel("org.eclipse.jetty", "WARN");
+        LoggerUtils.setLevel("org.onap.policy.controlloop", "INFO");
+        LoggerUtils.setLevel("network", "INFO");
     }
 
     /**