diff options
Diffstat (limited to 'src/lib/analytics/analytics.tsx')
-rw-r--r-- | src/lib/analytics/analytics.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/analytics/analytics.tsx b/src/lib/analytics/analytics.tsx index b3db9149c..71bb8569a 100644 --- a/src/lib/analytics/analytics.tsx +++ b/src/lib/analytics/analytics.tsx @@ -10,6 +10,7 @@ import {RootStoreModel, AppInfo} from 'state/models/root-store' import {useStores} from 'state/models/root-store' import {sha256} from 'js-sha256' import {ScreenEvent, TrackEvent} from './types' +import {logger} from '#/logger' const segmentClient = createClient({ writeKey: '8I6DsgfiSLuoONyaunGoiQM7A6y2ybdI', @@ -54,9 +55,9 @@ export function init(store: RootStoreModel) { if (sess.did) { const did_hashed = sha256(sess.did) segmentClient.identify(did_hashed, {did_hashed}) - store.log.debug('Ping w/hash') + logger.debug('Ping w/hash') } else { - store.log.debug('Ping w/o hash') + logger.debug('Ping w/o hash') segmentClient.identify() } } @@ -68,19 +69,19 @@ export function init(store: RootStoreModel) { // -prf segmentClient.isReady.onChange(() => { if (AppState.currentState !== 'active') { - store.log.debug('Prevented a metrics ping while the app was backgrounded') + logger.debug('Prevented a metrics ping while the app was backgrounded') return } const context = segmentClient.context.get() if (typeof context?.app === 'undefined') { - store.log.debug('Aborted metrics ping due to unavailable context') + logger.debug('Aborted metrics ping due to unavailable context') return } const oldAppInfo = store.appInfo const newAppInfo = context.app as AppInfo store.setAppInfo(newAppInfo) - store.log.debug('Recording app info', {new: newAppInfo, old: oldAppInfo}) + logger.debug('Recording app info', {new: newAppInfo, old: oldAppInfo}) if (typeof oldAppInfo === 'undefined') { if (store.session.hasSession) { |