feat: log speed source (native or calculated) for better debugging
This commit is contained in:
parent
1319167165
commit
ef187fbc73
1 changed files with 3 additions and 2 deletions
|
|
@ -256,7 +256,7 @@ class LocationTrackingService : Service() {
|
||||||
isMoving = (nativeSpeed ?: 0f) > 1.0f
|
isMoving = (nativeSpeed ?: 0f) > 1.0f
|
||||||
)
|
)
|
||||||
|
|
||||||
logEvent("LOCATION", "Lat: ${location.latitude}, Lon: ${location.longitude}, Speed: ${location.speed}")
|
logEvent("LOCATION", "Lat: ${location.latitude}, Lon: ${location.longitude}, Speed: ${location.speed} (native)")
|
||||||
|
|
||||||
updateNotification(location)
|
updateNotification(location)
|
||||||
|
|
||||||
|
|
@ -326,7 +326,8 @@ class LocationTrackingService : Service() {
|
||||||
logEvent("SPEED_CALC", "Speed calculation failed - sending without speed")
|
logEvent("SPEED_CALC", "Speed calculation failed - sending without speed")
|
||||||
// Fallback: send location without speed rather than losing it
|
// Fallback: send location without speed rather than losing it
|
||||||
} else {
|
} else {
|
||||||
logEvent("LOCATION", "Lat: ${location.latitude}, Lon: ${location.longitude}, Calc Speed: ${finalSpeed}")
|
val speedSource = if (location.hasSpeed() && location.speed > 0) "native" else "calculated"
|
||||||
|
logEvent("LOCATION", "Lat: ${location.latitude}, Lon: ${location.longitude}, Speed: ${finalSpeed} ($speedSource)")
|
||||||
}
|
}
|
||||||
|
|
||||||
val speedToSend = if (finalSpeed != null && finalSpeed > 0) finalSpeed else null
|
val speedToSend = if (finalSpeed != null && finalSpeed > 0) finalSpeed else null
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue