about summary refs log tree commit diff
path: root/src/lib/analytics/analytics.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-04 13:42:36 -0500
committerEric Bailey <git@esb.lol>2023-11-04 13:42:36 -0500
commitf51351e80d446fc058faf0ab91757ca4bdead0a5 (patch)
tree0c2372a71e605bfbb99b38113305b800ddd04064 /src/lib/analytics/analytics.tsx
parente49a3d8a564b2aa42a8c0e66dfcbae27d096dc26 (diff)
downloadvoidsky-f51351e80d446fc058faf0ab91757ca4bdead0a5.tar.zst
Replace all logs with new logger
Diffstat (limited to 'src/lib/analytics/analytics.tsx')
-rw-r--r--src/lib/analytics/analytics.tsx11
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) {