diff --git a/src/screens/Log.tsx b/src/screens/Log.tsx
index 2dd7fe84c0..aa31e2cea4 100644
--- a/src/screens/Log.tsx
+++ b/src/screens/Log.tsx
@@ -87,7 +87,21 @@ export function LogScreen({}: NativeStackScreenProps<
) : (
)}
- {String(entry.message)}
+
+ {entry.context && (
+
+ ({String(entry.context)})
+
+ )}
+ {String(entry.message)}
+
{entry.metadata &&
Object.keys(entry.metadata).length > 0 &&
(expanded.includes(entry.id) ? (
@@ -115,7 +129,9 @@ export function LogScreen({}: NativeStackScreenProps<
t.atoms.border_contrast_low,
]}>
- {JSON.stringify(entry.metadata, null, 2)}
+
+ {JSON.stringify(entry.metadata, null, 2)}
+
)}
diff --git a/src/state/geolocation/config.ts b/src/state/geolocation/config.ts
index 1f7f2daf22..913b674cbb 100644
--- a/src/state/geolocation/config.ts
+++ b/src/state/geolocation/config.ts
@@ -20,7 +20,7 @@ async function getGeolocationConfig(
})
if (!res.ok) {
- throw new Error(`geolocation config: fetch failed ${res.status}`)
+ throw new Error(`config: fetch failed ${res.status}`)
}
const json = await res.json()
@@ -35,7 +35,7 @@ async function getGeolocationConfig(
ageRestrictedGeos: json.ageRestrictedGeos ?? [],
ageBlockedGeos: json.ageBlockedGeos ?? [],
}
- logger.debug(`geolocation config: success`)
+ logger.debug(`config: success`)
return config
} else {
return undefined
@@ -85,7 +85,7 @@ export function beginResolveGeolocationConfig() {
} catch (e: any) {
success = false
- logger.debug(`geolocation config: failed initial request`, {
+ logger.debug(`config: failed initial request`, {
safeMessage: e.message,
})
@@ -101,12 +101,12 @@ export function beginResolveGeolocationConfig() {
success = true
} else {
// endpoint should throw on all failures, this is insurance
- throw new Error(`geolocation config: nothing returned from retries`)
+ throw new Error(`config: nothing returned from retries`)
}
})
.catch((e: any) => {
// complete fail closed
- logger.debug(`geolocation config: failed retries`, {
+ logger.debug(`config: failed retries`, {
safeMessage: e.message,
})
})
@@ -123,21 +123,19 @@ export function beginResolveGeolocationConfig() {
*/
export async function ensureGeolocationConfigIsResolved() {
if (!geolocationConfigResolution) {
- throw new Error(
- `geolocation config: beginResolveGeolocationConfig not called yet`,
- )
+ throw new Error(`config: beginResolveGeolocationConfig not called yet`)
}
const cached = device.get(['geolocation'])
if (cached) {
- logger.debug(`geolocation config: using cache`)
+ logger.debug(`config: using cache`)
} else {
- logger.debug(`geolocation config: no cache`)
+ logger.debug(`config: no cache`)
const {success} = await geolocationConfigResolution
if (success) {
- logger.debug(`geolocation config: resolved`)
+ logger.debug(`config: resolved`)
} else {
- logger.info(`geolocation config: failed to resolve`)
+ logger.info(`config: failed to resolve`)
}
}
}
diff --git a/src/state/geolocation/index.tsx b/src/state/geolocation/index.tsx
index d01e3f2623..8bddb23fb6 100644
--- a/src/state/geolocation/index.tsx
+++ b/src/state/geolocation/index.tsx
@@ -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,