2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.common.jsongraph.util;
23 import org.openecomp.sdc.common.log.wrappers.Logger;
26 * Provides common utility: functionality, common fields and enumerations
28 public class CommonUtility {
30 * Provides list of logging level names
32 public enum LogLevelEnum {
41 * Adds received message to log according to level in case if specified level is enabled
48 public static void addRecordToLog(Logger logger, LogLevelEnum logLevel, String format, Object... arguments) {
51 if (logger.isErrorEnabled()) {
52 logger.error(format, arguments);
56 if (logger.isWarnEnabled()) {
57 logger.warn(format, arguments);
61 if (logger.isInfoEnabled()) {
62 logger.info(format, arguments);
66 if (logger.isDebugEnabled()) {
67 logger.debug(format, arguments);
71 if (logger.isTraceEnabled()) {
72 logger.trace(format, arguments);