Skip to content

Commit

Permalink
whattheduck: Replace console.log() with console.info()
Browse files Browse the repository at this point in the history
  • Loading branch information
bperel committed Dec 26, 2024
1 parent 29b2f87 commit 0732f51
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apps/whattheduck/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const updateBundle = async () => {
const currentBundleVersion = (await CapacitorUpdater.current())?.bundle.version;
try {
const bundle = await socket.value!.app.services.getBundleUrl({ version: currentBundleVersion });
console.log('Latest bundle', bundle);
console.info('Latest bundle', bundle);
if (Capacitor.isNativePlatform() && 'url' in bundle && bundle.url) {
CapacitorUpdater.addListener('download', ({ percent }) => {
bundleDownloadProgress.value = percent / 100;
Expand All @@ -116,11 +116,11 @@ const updateBundle = async () => {
await CapacitorUpdater.set(bundleInfo);
}
} catch (e) {
console.log('getBundleUrl failed', e);
console.info('getBundleUrl failed', e);
const { error, errorDetails } = e as unknown as { error: string; errorDetails: string };
switch (error) {
case 'Already up to date':
console.log('Bundle is already up to date');
console.info('Bundle is already up to date');
break;
default:
console.warn(error, errorDetails);
Expand Down
6 changes: 3 additions & 3 deletions apps/whattheduck/src/composables/usePersistedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { Storage } from '@ionic/storage';

export default async (entries: Record<string, Ref<unknown>>): Promise<void> => {
const storage = injectLocal<Storage>('storage')!;
console.log('keys in cache: ', JSON.stringify(Object.entries(storage.keys())));
console.info('keys in cache: ', JSON.stringify(Object.entries(storage.keys())));
for (const [storageKey, persistedRef] of Object.entries(entries)) {
const storageValue = await storage.get(storageKey);
console.log({ storageKey, storageValue });
console.info({ storageKey, storageValue });
if (storageValue !== null) {
try {
persistedRef.value = JSON.parse(storageValue);
Expand All @@ -18,7 +18,7 @@ export default async (entries: Record<string, Ref<unknown>>): Promise<void> => {
watch(
Object.values(entries),
async () => {
console.log('saving entries', entries);
console.info('saving entries', entries);
for (const [storageKey, persistedRef] of Object.entries(entries)) {
await storage.set(storageKey, JSON.stringify(persistedRef.value));
}
Expand Down
2 changes: 1 addition & 1 deletion apps/whattheduck/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ router.isReady().then(async () => {
name: 'whattheduck',
});
await storage.create();
console.log({ 'storage driver': storage.driver });
console.info({ 'storage driver': storage.driver });
app.provide('storage', storage);
app.mount('#app');
});
4 changes: 2 additions & 2 deletions apps/whattheduck/src/stores/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ export const app = defineStore('app', () => {
},
] as const;

console.log('token before usePersistedData', token.value);
console.info('token before usePersistedData', token.value);
usePersistedData({
token,
}).then(() => {
console.log({ token: token.value });
console.info({ token: token.value });
if (!token.value) {
token.value = null;
}
Expand Down

0 comments on commit 0732f51

Please sign in to comment.