add logging

This commit is contained in:
Andrei Vereha 2021-08-05 21:23:45 +02:00
parent 042a21d8da
commit 6cb742d4e9

View file

@ -124,9 +124,18 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
override val sameTimeZone: Boolean override val sameTimeZone: Boolean
get() { get() {
val now = System.currentTimeMillis() val now = System.currentTimeMillis()
val currentOffset = TimeZone.getDefault().getOffset(now) val currentTimezone = TimeZone.getDefault()
val currentOffset = currentTimezone.getOffset(now)
val podOffset = timeZone.getOffset(now) val podOffset = timeZone.getOffset(now)
logger.debug(LTag.PUMPCOMM, "sameTimeZone currentOffset=$currentOffset podOffset=$podOffset") logger.debug(
LTag.PUMPCOMM,
"sameTimeZone currentTimezone=${currentTimezone.getDisplayName(
true,
TimeZone.SHORT
)} " +
"currentOffset=$currentOffset " +
"podOffset=$podOffset"
)
return currentOffset == podOffset return currentOffset == podOffset
} }
@ -588,7 +597,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
override fun updateFromAlarmStatusResponse(response: AlarmStatusResponse) { override fun updateFromAlarmStatusResponse(response: AlarmStatusResponse) {
logger.info( logger.info(
LTag.PUMP, LTag.PUMP,
"Received AlarmStatusReponse: $response" "Received AlarmStatusResponse: $response"
) )
podState.deliveryStatus = response.deliveryStatus podState.deliveryStatus = response.deliveryStatus
podState.podStatus = response.podStatus podState.podStatus = response.podStatus