1 package org.openecomp.sdc.common.ecomplog;
3 import static org.openecomp.sdc.common.ecomplog.api.IEcompLogConfiguration.MDC_BEGIN_TIMESTAMP;
4 import static org.openecomp.sdc.common.ecomplog.api.IEcompLogConfiguration.MDC_KEY_REQUEST_ID;
6 import org.openecomp.sdc.common.ecomplog.Enums.LogLevel;
7 import org.openecomp.sdc.common.ecomplog.Enums.LogMarkers;
8 import org.openecomp.sdc.common.ecomplog.api.IEcompMdcWrapper;
9 import org.slf4j.MarkerFactory;
11 public class EcompLoggerDebug extends EcompLoggerBase {
13 private static EcompLoggerDebug instanceLoggerDebug = EcompLoggerFactory.getLogger(EcompLoggerDebug.class);
15 protected final String endOfRecordDelimiter = "|^\\n";
17 EcompLoggerDebug(IEcompMdcWrapper ecompMdcWrapper) {
18 super(ecompMdcWrapper, MarkerFactory.getMarker(LogMarkers.DEBUG_MARKER.text()));
21 public static EcompLoggerDebug getInstance() {
22 return instanceLoggerDebug;
26 public void log(LogLevel errorLevel, String message) {
27 String formattedMessage = String.format("%s%s", message, endOfRecordDelimiter);
28 super.log(errorLevel, formattedMessage);
32 public void initializeMandatoryFields() {
33 ecompMdcWrapper.setMandatoryField(MDC_BEGIN_TIMESTAMP);
34 ecompMdcWrapper.setMandatoryField(MDC_KEY_REQUEST_ID);
38 public EcompLoggerDebug clear() {
39 return (EcompLoggerDebug) super.clear();
43 public EcompLoggerDebug startTimer() {
44 return (EcompLoggerDebug) super.startTimer();
48 public EcompLoggerDebug setKeyRequestId(String keyRequestId) {
49 return (EcompLoggerDebug) super.setKeyRequestId(keyRequestId);