remove StacktraceLoggerWrapper
This commit is contained in:
parent
32f3aee6ef
commit
369bf25647
|
@ -1,14 +1,11 @@
|
||||||
package info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history_events;
|
package info.nightscout.androidaps.plugins.pump.insight.app_layer.history.history_events;
|
||||||
|
|
||||||
import info.nightscout.shared.logging.StacktraceLoggerWrapper;
|
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.ids.HistoryEventIDs;
|
import info.nightscout.androidaps.plugins.pump.insight.ids.HistoryEventIDs;
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.utils.BOCUtil;
|
import info.nightscout.androidaps.plugins.pump.insight.utils.BOCUtil;
|
||||||
import info.nightscout.androidaps.plugins.pump.insight.utils.ByteBuf;
|
import info.nightscout.androidaps.plugins.pump.insight.utils.ByteBuf;
|
||||||
import org.slf4j.Logger;
|
|
||||||
|
|
||||||
public class HistoryEvent implements Comparable<HistoryEvent> {
|
public class HistoryEvent implements Comparable<HistoryEvent> {
|
||||||
@SuppressWarnings("deprecation")
|
//private static final Logger log = StacktraceLoggerWrapper.Companion.getLogger(HistoryEvent.class);
|
||||||
private static final Logger log = StacktraceLoggerWrapper.Companion.getLogger(HistoryEvent.class);
|
|
||||||
|
|
||||||
private int eventYear;
|
private int eventYear;
|
||||||
private int eventMonth;
|
private int eventMonth;
|
||||||
|
@ -27,7 +24,7 @@ public class HistoryEvent implements Comparable<HistoryEvent> {
|
||||||
try {
|
try {
|
||||||
event = eventClass.newInstance();
|
event = eventClass.newInstance();
|
||||||
} catch (IllegalAccessException | InstantiationException e) {
|
} catch (IllegalAccessException | InstantiationException e) {
|
||||||
log.error("Unhandled exception", e);
|
//log.error("Unhandled exception", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.parseHeader(byteBuf);
|
event.parseHeader(byteBuf);
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
package info.nightscout.shared.logging
|
|
||||||
|
|
||||||
import org.slf4j.Logger
|
|
||||||
import org.slf4j.LoggerFactory
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by adrian on 2020-01-13.
|
|
||||||
*/
|
|
||||||
|
|
||||||
class StacktraceLoggerWrapper(private val delegate: Logger) : Logger by delegate {
|
|
||||||
|
|
||||||
override fun debug(msg: String?) {
|
|
||||||
delegate.debug(stackLogMarker() + msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun debug(format: String?, arg: Any?) {
|
|
||||||
delegate.debug(stackLogMarker() + format, arg)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun info(msg: String?) {
|
|
||||||
delegate.info(stackLogMarker() + msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun error(msg: String?) {
|
|
||||||
delegate.error(stackLogMarker() + msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun warn(msg: String?) {
|
|
||||||
delegate.warn(stackLogMarker() + msg)
|
|
||||||
}
|
|
||||||
|
|
||||||
// all other methods will be implemented by delegate
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
|
|
||||||
@Deprecated("please inject AAPSLogger")
|
|
||||||
fun getLogger(clazz: Class<*>) = StacktraceLoggerWrapper(LoggerFactory.getLogger(clazz))
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue