Merge pull request 'Add missing log method's contents in logger component' (#118) from kavindya_devindi/device-mgt-core:master into master

Reviewed-on: community/device-mgt-core#118
vpp-v2
Charitha Goonetilleke 2 years ago
commit ea4b7ac97b

@ -35,96 +35,104 @@ public class EntgraDeviceLoggerImpl implements EntgraLogger {
log = LogFactory.getLog(clazz); log = LogFactory.getLog(clazz);
} }
@Override public void info(String message) {
public void info(Object object, LogContext logContext) { log.info(message);
}
@Override
public void info(Object object, Throwable t, LogContext logContext) {
} }
@Override public void info(String message, Throwable t) {
public void debug(Object object, LogContext logContext) { log.info(message, t);
} }
@Override @Override
public void debug(Object object, Throwable t, LogContext logContext) { public void info(Object o) {
log.info(o);
} }
@Override @Override
public void error(Object object, LogContext logContext) { public void info(Object o, Throwable throwable) {
log.info(o, throwable);
} }
@Override @Override
public void error(Object object, Throwable t, LogContext logContext) { public void info(String message, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.info(message);
} }
@Override @Override
public void fatal(Object object, LogContext logContext) { public void info(Object object, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.info(object);
} }
@Override @Override
public void fatal(Object object, Throwable t, LogContext logContext) { public void info(Object object, Throwable t, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.info(object, t);
} }
@Override
public void trace(Object object, LogContext logContext) {
public void debug(String message) {
log.debug(message);
} }
@Override public void debug(String message, Throwable t) {
public void trace(Object object, Throwable t, LogContext logContext) { log.debug(message, t);
} }
@Override @Override
public void warn(Object object, LogContext logContext) { public void debug(Object o) {
log.debug(o);
} }
@Override @Override
public void warn(Object object, Throwable t, LogContext logContext) { public void debug(Object o, Throwable throwable) {
} log.debug(o, throwable);
public void info(String message) {
}
public void info(String message, Throwable t) {
log.info(message, t);
} }
@Override @Override
public void info(String message, LogContext logContext) { public void debug(String message, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext; DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext); MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.info(message);
}
public void debug(String message) {
log.debug(message); log.debug(message);
} }
@Override
public void debug(String message, Throwable t) { public void debug(Object object, LogContext logContext) {
log.debug(message, t); DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.debug(object);
} }
@Override @Override
public void debug(String message, LogContext logContext) { public void debug(Object object, Throwable t, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext; DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext); MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.debug(message); log.debug(object, t);
} }
public void error(String message) { public void error(String message) {
log.error(message); log.error(message);
} }
public void error(String message, Throwable t) { public void error(String message, Throwable t) {
log.error(message, t); log.error(message, t);
} }
@Override
public void error(Object o) {
log.error(o);
}
@Override
public void error(Object o, Throwable throwable) {
log.error(o, throwable);
}
@Override @Override
public void error(String message, LogContext logContext) { public void error(String message, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext; DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
@ -139,16 +147,39 @@ public class EntgraDeviceLoggerImpl implements EntgraLogger {
log.error(message, t); log.error(message, t);
} }
@Override
public void error(Object object, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.error(object);
}
@Override
public void error(Object object, Throwable t, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.error(object, t);
}
public void warn(String message) { public void warn(String message) {
log.warn(message); log.warn(message);
} }
public void warn(String message, Throwable t) { public void warn(String message, Throwable t) {
log.warn(message, t); log.warn(message, t);
} }
@Override
public void warn(Object o) {
log.warn(o);
}
@Override
public void warn(Object o, Throwable throwable) {
log.warn(o, throwable);
}
@Override @Override
public void warn(String message, LogContext logContext) { public void warn(String message, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext; DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
@ -163,58 +194,67 @@ public class EntgraDeviceLoggerImpl implements EntgraLogger {
log.warn(message, t); log.warn(message, t);
} }
@Override
public void warn(Object object, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.warn(object);
}
@Override
public void warn(Object object, Throwable t, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.warn(object, t);
}
public void trace(String message) { public void trace(String message) {
log.trace(message); log.trace(message);
} }
public void trace(String message, Throwable t) { public void trace(String message, Throwable t) {
log.trace(message, t); log.trace(message, t);
} }
@Override @Override
public void trace(String message, LogContext logContext) { public void trace(Object o) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext; log.trace(o);
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.trace(message);
}
public void fatal(String message) {
log.fatal(message);
} }
@Override
public void fatal(String message, Throwable t) { public void trace(Object o, Throwable throwable) {
log.fatal(message, t); log.trace(o, throwable);
} }
@Override @Override
public void fatal(String message, LogContext logContext) { public void trace(String message, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext; DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext); MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.fatal(message); log.trace(message);
} }
@Override @Override
public void debug(Object o) { public void trace(Object object, LogContext logContext) {
log.debug(o); DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.trace(object);
} }
@Override @Override
public void debug(Object o, Throwable throwable) { public void trace(Object object, Throwable t, LogContext logContext) {
log.debug(o, throwable); DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.trace(object, t);
} }
@Override
public void error(Object o) { public void fatal(String message) {
log.error(o); log.fatal(message);
} }
@Override public void fatal(String message, Throwable t) {
public void error(Object o, Throwable throwable) { log.fatal(message, t);
log.error(o, throwable);
} }
@Override @Override
@ -228,13 +268,24 @@ public class EntgraDeviceLoggerImpl implements EntgraLogger {
} }
@Override @Override
public void info(Object o) { public void fatal(String message, LogContext logContext) {
log.info(o); DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.fatal(message);
} }
@Override @Override
public void info(Object o, Throwable throwable) { public void fatal(Object object, LogContext logContext) {
log.info(o, throwable); DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.fatal(object);
}
@Override
public void fatal(Object object, Throwable t, LogContext logContext) {
DeviceLogContext deviceLogContext = (DeviceLogContext) logContext;
MDCContextUtil.populateDeviceMDCContext(deviceLogContext);
log.fatal(object, t);
} }
@Override @Override
@ -267,26 +318,6 @@ public class EntgraDeviceLoggerImpl implements EntgraLogger {
return log.isWarnEnabled(); return log.isWarnEnabled();
} }
@Override
public void trace(Object o) {
log.trace(o);
}
@Override
public void trace(Object o, Throwable throwable) {
log.trace(o, throwable);
}
@Override
public void warn(Object o) {
log.warn(o);
}
@Override
public void warn(Object o, Throwable throwable) {
log.warn(o, throwable);
}
@Override @Override
public void clearLogContext() { public void clearLogContext() {
MDC.clear(); MDC.clear();

@ -35,96 +35,104 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
log = LogFactory.getLog(clazz); log = LogFactory.getLog(clazz);
} }
@Override public void info(String message) {
public void info(Object object, LogContext logContext) { log.info(message);
}
@Override
public void info(Object object, Throwable t, LogContext logContext) {
} }
@Override public void info(String message, Throwable t) {
public void debug(Object object, LogContext logContext) { log.info(message, t);
} }
@Override @Override
public void debug(Object object, Throwable t, LogContext logContext) { public void info(Object o) {
log.info(o);
} }
@Override @Override
public void error(Object object, LogContext logContext) { public void info(Object o, Throwable throwable) {
log.info(o, throwable);
} }
@Override @Override
public void error(Object object, Throwable t, LogContext logContext) { public void info(String message, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.info(message);
} }
@Override @Override
public void fatal(Object object, LogContext logContext) { public void info(Object object, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.info(object);
} }
@Override @Override
public void fatal(Object object, Throwable t, LogContext logContext) { public void info(Object object, Throwable t, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.info(object, t);
} }
@Override
public void trace(Object object, LogContext logContext) {
public void debug(String message) {
log.debug(message);
} }
@Override public void debug(String message, Throwable t) {
public void trace(Object object, Throwable t, LogContext logContext) { log.debug(message, t);
} }
@Override @Override
public void warn(Object object, LogContext logContext) { public void debug(Object o) {
log.debug(o);
} }
@Override @Override
public void warn(Object object, Throwable t, LogContext logContext) { public void debug(Object o, Throwable throwable) {
} log.debug(o, throwable);
public void info(String message) {
}
public void info(String message, Throwable t) {
log.info(message, t);
} }
@Override @Override
public void info(String message, LogContext logContext) { public void debug(String message, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext; UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext); MDCContextUtil.populateUserMDCContext(userLogContext);
log.info(message);
}
public void debug(String message) {
log.debug(message); log.debug(message);
} }
@Override
public void debug(String message, Throwable t) { public void debug(Object object, LogContext logContext) {
log.debug(message, t); UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.debug(object);
} }
@Override @Override
public void debug(String message, LogContext logContext) { public void debug(Object object, Throwable t, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext; UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext); MDCContextUtil.populateUserMDCContext(userLogContext);
log.debug(message); log.debug(object, t);
} }
public void error(String message) { public void error(String message) {
log.error(message); log.error(message);
} }
public void error(String message, Throwable t) { public void error(String message, Throwable t) {
log.error(message, t); log.error(message, t);
} }
@Override
public void error(Object o) {
log.error(o);
}
@Override
public void error(Object o, Throwable throwable) {
log.error(o, throwable);
}
@Override @Override
public void error(String message, LogContext logContext) { public void error(String message, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext; UserLogContext userLogContext = (UserLogContext) logContext;
@ -139,16 +147,39 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
log.error(message, t); log.error(message, t);
} }
@Override
public void error(Object object, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.error(object);
}
@Override
public void error(Object object, Throwable t, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.error(object, t);
}
public void warn(String message) { public void warn(String message) {
log.warn(message); log.warn(message);
} }
public void warn(String message, Throwable t) { public void warn(String message, Throwable t) {
log.warn(message, t); log.warn(message, t);
} }
@Override
public void warn(Object o) {
log.warn(o);
}
@Override
public void warn(Object o, Throwable throwable) {
log.warn(o, throwable);
}
@Override @Override
public void warn(String message, LogContext logContext) { public void warn(String message, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext; UserLogContext userLogContext = (UserLogContext) logContext;
@ -163,58 +194,67 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
log.warn(message, t); log.warn(message, t);
} }
@Override
public void warn(Object object, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.warn(object);
}
@Override
public void warn(Object object, Throwable t, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.warn(object, t);
}
public void trace(String message) { public void trace(String message) {
log.trace(message); log.trace(message);
} }
public void trace(String message, Throwable t) { public void trace(String message, Throwable t) {
log.trace(message, t); log.trace(message, t);
} }
@Override @Override
public void trace(String message, LogContext logContext) { public void trace(Object o) {
UserLogContext userLogContext = (UserLogContext) logContext; log.trace(o);
MDCContextUtil.populateUserMDCContext(userLogContext);
log.trace(message);
}
public void fatal(String message) {
log.fatal(message);
} }
@Override
public void fatal(String message, Throwable t) { public void trace(Object o, Throwable throwable) {
log.fatal(message, t); log.trace(o, throwable);
} }
@Override @Override
public void fatal(String message, LogContext logContext) { public void trace(String message, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext; UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext); MDCContextUtil.populateUserMDCContext(userLogContext);
log.fatal(message); log.trace(message);
} }
@Override @Override
public void debug(Object o) { public void trace(Object object, LogContext logContext) {
log.debug(o); UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.trace(object);
} }
@Override @Override
public void debug(Object o, Throwable throwable) { public void trace(Object object, Throwable t, LogContext logContext) {
log.debug(o, throwable); UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.trace(object, t);
} }
@Override
public void error(Object o) { public void fatal(String message) {
log.error(o); log.fatal(message);
} }
@Override public void fatal(String message, Throwable t) {
public void error(Object o, Throwable throwable) { log.fatal(message, t);
log.error(o, throwable);
} }
@Override @Override
@ -228,13 +268,24 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
} }
@Override @Override
public void info(Object o) { public void fatal(String message, LogContext logContext) {
log.info(o); UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.fatal(message);
} }
@Override @Override
public void info(Object o, Throwable throwable) { public void fatal(Object object, LogContext logContext) {
log.info(o, throwable); UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.fatal(object);
}
@Override
public void fatal(Object object, Throwable t, LogContext logContext) {
UserLogContext userLogContext = (UserLogContext) logContext;
MDCContextUtil.populateUserMDCContext(userLogContext);
log.fatal(object, t);
} }
@Override @Override
@ -267,26 +318,6 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
return log.isWarnEnabled(); return log.isWarnEnabled();
} }
@Override
public void trace(Object o) {
log.trace(o);
}
@Override
public void trace(Object o, Throwable throwable) {
log.trace(o, throwable);
}
@Override
public void warn(Object o) {
log.warn(o);
}
@Override
public void warn(Object o, Throwable throwable) {
log.warn(o, throwable);
}
@Override @Override
public void clearLogContext() { public void clearLogContext() {
MDC.clear(); MDC.clear();

Loading…
Cancel
Save