diff options
author | noahs <noah.shogan@gmail.com> | 2017-12-06 13:11:38 +0200 |
---|---|---|
committer | noahs <noah.shogan@amdocs.com> | 2017-12-06 17:38:57 +0200 |
commit | f9f112f5fd5b193e79e38442cc566b7b437f87d2 (patch) | |
tree | 01a1ef7f840cbacb5ed465095926d14e83a7fd27 /common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java | |
parent | 0566f581c0f310384f42838c388f57234ed1d60e (diff) |
Duplicate logging frameworks merging
There was two copies of the SDC logging framework
Change-Id: I55c94c9817a83162c6d90e504dfd91e4858c7269
Issue-ID: SDC-703
Signed-off-by: noahs <noah.shogan@amdocs.com>
Diffstat (limited to 'common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java')
-rw-r--r-- | common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java | 232 |
1 files changed, 0 insertions, 232 deletions
diff --git a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java b/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java deleted file mode 100644 index fdc874ee54..0000000000 --- a/common/openecomp-logging-lib/openecomp-logging-api/src/main/java/org/openecomp/core/logging/api/LoggerFactory.java +++ /dev/null @@ -1,232 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 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.core.logging.api; - -/** - * <a>Factory to hide a concrete, framework-specific implementation of logger creation.</a> <p>The - * service used by this factory must implement {@link LoggerCreationService}. If no implementation - * has been configured or could not be instantiated, a <b>no-op logger</b> will be used, and <b>no - * events</b> will be logged. This is done to prevent recursion if attempts are being made to log - * exceptions that resulted from logger initialization. </p> - * - * @see BaseFactory - * @see LoggerCreationService - */ -@SuppressWarnings("ThrowableInstanceNeverThrown") -public class LoggerFactory extends BaseFactory { - - private static final LoggerCreationService SERVICE; - - static { - - LoggerCreationService service; - - try { - service = locateService(LoggerCreationService.class); - } catch (Exception e) { - new RuntimeException("Failed to instantiate logger factory", e).printStackTrace(); - // use the no-op service to prevent recursion in case of an attempt to log an exception as a - // result of a logger initialization error - service = new NoOpLoggerCreationService(); - } - - SERVICE = service; - } - - public static Logger getLogger(String clazzName) { - return SERVICE.getLogger(clazzName); - } - - public static Logger getLogger(Class<?> clazz) { - return SERVICE.getLogger(clazz); - } - - private static class NoOpLoggerCreationService implements LoggerCreationService { - - private static final Logger NO_OP_LOGGER = new Logger() { - - @Override - public String getName() { - return "No-Op Logger"; - } - - @Override - public boolean isMetricsEnabled() { - return false; - } - - @Override - public void metrics(String msg) { - } - - @Override - public void metrics(String msg, Object arg) { - } - - @Override - public void metrics(String msg, Object arg1, Object arg2) { - } - - @Override - public void metrics(String msg, Object... arguments) { - } - - @Override - public void metrics(String msg, Throwable throwable) { - } - - @Override - public boolean isAuditEnabled() { - return false; - } - - @Override - public void audit(String msg) { - } - - @Override - public void audit(String msg, Object arg) { - } - - @Override - public void audit(String msg, Object arg1, Object arg2) { - } - - @Override - public void audit(String msg, Object... arguments) { - } - - @Override - public void audit(String msg, Throwable throwable) { - } - - @Override - public boolean isDebugEnabled() { - return false; - } - - @Override - public void debug(String msg) { - } - - @Override - public void debug(String msg, Object arg) { - } - - @Override - public void debug(String msg, Object arg1, Object arg2) { - } - - @Override - public void debug(String msg, Object... arguments) { - } - - @Override - public void debug(String msg, Throwable throwable) { - } - - @Override - public boolean isInfoEnabled() { - return false; - } - - @Override - public void info(String msg) { - } - - @Override - public void info(String msg, Object arg) { - } - - @Override - public void info(String msg, Object arg1, Object arg2) { - } - - @Override - public void info(String msg, Object... arguments) { - } - - @Override - public void info(String msg, Throwable throwable) { - } - - @Override - public boolean isWarnEnabled() { - return false; - } - - @Override - public void warn(String msg) { - } - - @Override - public void warn(String msg, Object arg) { - } - - @Override - public void warn(String msg, Object... arguments) { - } - - @Override - public void warn(String msg, Object arg1, Object arg2) { - } - - @Override - public void warn(String msg, Throwable throwable) { - } - - @Override - public boolean isErrorEnabled() { - return false; - } - - @Override - public void error(String msg) { - } - - @Override - public void error(String msg, Object arg) { - } - - @Override - public void error(String msg, Object arg1, Object arg2) { - } - - @Override - public void error(String msg, Object... arguments) { - } - - @Override - public void error(String msg, Throwable throwable) { - } - }; - - @Override - public Logger getLogger(String className) { - return NO_OP_LOGGER; - } - - @Override - public Logger getLogger(Class<?> clazz) { - return NO_OP_LOGGER; - } - } -} |