Make logs more clear (#8991)

This commit is contained in:
Eric Bailey
2025-09-05 10:25:42 -05:00
committed by GitHub
parent 01ba0d0ed6
commit 0f089060d2
3 changed files with 33 additions and 17 deletions
+5 -3
View File
@@ -91,11 +91,13 @@ export function GeolocationStatusProvider({
const configContext = React.useMemo(() => ({config}), [config])
const statusContext = React.useMemo(() => {
if (deviceGeolocation) {
logger.debug('geolocation: has device geolocation available')
if (deviceGeolocation?.countryCode) {
logger.debug('has device geolocation available')
}
const geolocation = mergeGeolocation(deviceGeolocation, config)
const status = computeGeolocationStatus(geolocation, config)
// ensure this remains debug and never leaves device
logger.debug('result', {deviceGeolocation, geolocation, status, config})
return {location: geolocation, status}
}, [config, deviceGeolocation])
@@ -117,7 +119,7 @@ export function Provider({children}: {children: React.ReactNode}) {
const handleSetDeviceGeolocation = React.useCallback(
(location: DeviceLocation) => {
logger.debug('geolocation: setting device geolocation')
logger.debug('setting device geolocation')
setDeviceGeolocation({
countryCode: location.countryCode ?? undefined,
regionCode: location.regionCode ?? undefined,