2 * Copyright © 2016-2017 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.logging.slf4j;
19 import org.openecomp.sdc.logging.api.Logger;
20 import org.slf4j.LoggerFactory;
26 class SLF4JLoggerWrapper implements Logger {
28 private final org.slf4j.Logger logger;
30 SLF4JLoggerWrapper(Class<?> clazz) {
31 logger = LoggerFactory.getLogger(clazz);
34 SLF4JLoggerWrapper(String className) {
35 logger = LoggerFactory.getLogger(className);
39 public String getName() {
40 return logger.getName();
44 public boolean isMetricsEnabled() {
45 return logger.isInfoEnabled(Markers.METRICS);
49 public void metrics(String msg) {
50 logger.info(Markers.METRICS, msg);
54 public void metrics(String msg, Object arg) {
55 logger.info(Markers.METRICS, msg, arg);
59 public void metrics(String msg, Object arg1, Object arg2) {
60 logger.info(Markers.METRICS, msg, arg1, arg2);
64 public void metrics(String msg, Object... arguments) {
65 logger.info(Markers.METRICS, msg, arguments);
69 public void metrics(String msg, Throwable t) {
70 logger.info(Markers.METRICS, msg, t);
74 public boolean isAuditEnabled() {
75 return logger.isInfoEnabled(Markers.AUDIT);
79 public void audit(String msg) {
80 logger.info(Markers.AUDIT, msg);
84 public void audit(String msg, Object arg) {
85 logger.info(Markers.AUDIT, msg, arg);
89 public void audit(String msg, Object arg1, Object arg2) {
90 logger.info(Markers.AUDIT, msg, arg1, arg2);
94 public void audit(String msg, Object... arguments) {
95 logger.info(Markers.AUDIT, msg, arguments);
99 public void audit(String msg, Throwable t) {
100 logger.info(Markers.AUDIT, msg, t);
104 public boolean isDebugEnabled() {
105 return logger.isDebugEnabled();
109 public void debug(String msg) {
114 public void debug(String format, Object arg) {
115 logger.debug(format, arg);
119 public void debug(String format, Object arg1, Object arg2) {
120 logger.debug(format, arg1, arg2);
124 public void debug(String format, Object... arguments) {
125 logger.debug(format, arguments);
129 public void debug(String msg, Throwable t) {
130 logger.debug(msg, t);
134 public boolean isInfoEnabled() {
135 return logger.isInfoEnabled();
139 public void info(String msg) {
144 public void info(String format, Object arg) {
145 logger.info(format, arg);
149 public void info(String format, Object arg1, Object arg2) {
150 logger.info(format, arg1, arg2);
154 public void info(String format, Object... arguments) {
155 logger.info(format, arguments);
159 public void info(String msg, Throwable t) {
164 public boolean isWarnEnabled() {
165 return logger.isWarnEnabled();
169 public void warn(String msg) {
174 public void warn(String format, Object arg) {
175 logger.warn(format, arg);
179 public void warn(String format, Object... arguments) {
180 logger.warn(format, arguments);
184 public void warn(String format, Object arg1, Object arg2) {
185 logger.warn(format, arg1, arg2);
189 public void warn(String msg, Throwable t) {
194 public boolean isErrorEnabled() {
195 return logger.isErrorEnabled();
199 public void error(String msg) {
204 public void error(String format, Object arg) {
205 logger.error(format, arg);
209 public void error(String format, Object arg1, Object arg2) {
210 logger.error(format, arg1, arg2);
214 public void error(String format, Object... arguments) {
215 logger.error(format, arguments);
219 public void error(String msg, Throwable t) {
220 logger.error(msg, t);