summaryrefslogtreecommitdiffstats
path: root/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java')
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java78
1 files changed, 0 insertions, 78 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java b/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java
deleted file mode 100644
index 41c76a3ebe..0000000000
--- a/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2019 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.sdc.common.log.elements;
-
-import org.slf4j.Logger;
-
-/**
- * Created by dd4296 on 12/26/2017.
- * this factory helps decouple the classes for Stopwatch and LogFieldsMdcHandler from
- * the EcompLogger classes
- */
-public class LoggerFactory {
-
- private LoggerFactory() {
- }
-
- @SuppressWarnings("unchecked")
- public static <T, V> V getLogger(Class<T> type, Logger logger) {
-
- if (type.isAssignableFrom(LoggerAudit.class)) {
- return (V) new LoggerAudit(new LogFieldsMdcHandler(), logger);
- }
-
- if (type.isAssignableFrom(LoggerDebug.class)) {
- return (V) new LoggerDebug(new LogFieldsMdcHandler(), logger);
- }
-
- if (type.isAssignableFrom(LoggerMetric.class)) {
- return (V) new LoggerMetric(new LogFieldsMdcHandler(), logger);
- }
-
- if (type.isAssignableFrom(LoggerError.class)) {
- return (V) new LoggerError(new LogFieldsMdcHandler(), logger);
- }
-
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public static <T, V> V getMdcLogger(Class<T> type, Logger logger) {
-
- if (type.isAssignableFrom(LoggerAudit.class)) {
- return (V) new LoggerAudit(LogFieldsMdcHandler.getInstance(), logger);
- }
-
- if (type.isAssignableFrom(LoggerDebug.class)) {
- return (V) new LoggerDebug(LogFieldsMdcHandler.getInstance(), logger);
- }
-
- if (type.isAssignableFrom(LoggerMetric.class)) {
- return (V) new LoggerMetric(LogFieldsMdcHandler.getInstance(), logger);
- }
-
- if (type.isAssignableFrom(LoggerError.class)) {
- return (V) new LoggerError(LogFieldsMdcHandler.getInstance(), logger);
- }
-
- return null;
- }
-}