diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-01-02 17:38:13 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2023-01-02 17:38:13 -0600 |
commit | f6a0e634d78eb97d1d877033bf620ea982038731 (patch) | |
tree | 5d6b7ccbc8f6a587c3910c760bceeefda0c0a291 /src/state/index.ts | |
parent | 99cec71ed798b29079eb474acd6f7cc799b51a51 (diff) | |
download | voidsky-f6a0e634d78eb97d1d877033bf620ea982038731.tar.zst |
Implement logging system
Diffstat (limited to 'src/state/index.ts')
-rw-r--r-- | src/state/index.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/state/index.ts b/src/state/index.ts index aa24eb27e..a8b95cc65 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -24,19 +24,19 @@ export async function setupState() { try { data = (await storage.load(ROOT_STATE_STORAGE_KEY)) || {} rootStore.hydrate(data) - } catch (e) { - console.error('Failed to load state from storage', e) + } catch (e: any) { + rootStore.log.error('Failed to load state from storage', e.toString()) } - console.log('Initial hydrate', rootStore.me) + rootStore.log.debug('Initial hydrate') rootStore.session .connect() .then(() => { - console.log('Session connected', rootStore.me) + rootStore.log.debug('Session connected') return rootStore.fetchStateUpdate() }) - .catch(e => { - console.log('Failed initial connect', e) + .catch((e: any) => { + rootStore.log.warn('Failed initial connect', e.toString()) }) // @ts-ignore .on() is correct -prf api.sessionManager.on('session', () => { |