Skip to content

Commit f050515

Browse files
committed
chore: remove .log, add prefixes to logs
1 parent 4da5be3 commit f050515

File tree

6 files changed

+28
-11
lines changed

6 files changed

+28
-11
lines changed

src/api/Action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class ActionComponent {
178178
if (!response.ok) {
179179
const error = (await response.json()) as ActionError;
180180
console.error(
181-
`Failed to execute action ${proxyUrl}, href ${this.href}, reason: ${error.message}`,
181+
`[@dialectlabs/blinks] Failed to execute action ${proxyUrl}, href ${this.href}, reason: ${error.message}`,
182182
);
183183

184184
throw {

src/api/ActionConfig.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ export class ActionConfig implements ActionAdapter {
8080
return;
8181
}
8282
} catch (e) {
83-
console.error('Error confirming transaction', e);
83+
console.error(
84+
'[@dialectlabs/blinks] Error confirming transaction',
85+
e,
86+
);
8487
}
8588

8689
setTimeout(confirm, 3000);

src/api/ActionsRegistry.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export class ActionsRegistry {
5858
url: string | URL,
5959
type: LookupType = 'action',
6060
): RegisteredEntity | null {
61-
console.log(`Looking up ${type} for URL: ${url}`);
6261
if (type === 'action') {
6362
return this.lookupAction(url);
6463
}
@@ -80,7 +79,10 @@ export class ActionsRegistry {
8079
const host = urlObj.host;
8180
return this.actionsByHost[host] ?? null;
8281
} catch (e) {
83-
console.error(`Failed to lookup action for URL: ${url}`, e);
82+
console.error(
83+
`[@dialectlabs/blinks] Failed to lookup action for URL: ${url}`,
84+
e,
85+
);
8486
return null;
8587
}
8688
}
@@ -91,7 +93,10 @@ export class ActionsRegistry {
9193
const host = urlObj.host;
9294
return this.websitesByHost[host] ?? null;
9395
} catch (e) {
94-
console.error(`Failed to lookup website for URL: ${url}`, e);
96+
console.error(
97+
`[@dialectlabs/blinks] Failed to lookup website for URL: ${url}`,
98+
e,
99+
);
95100
return null;
96101
}
97102
}
@@ -102,7 +107,10 @@ export class ActionsRegistry {
102107
const host = urlObj.host;
103108
return this.interstitialsByHost[host] ?? null;
104109
} catch (e) {
105-
console.error(`Failed to lookup interstitial for URL: ${url}`, e);
110+
console.error(
111+
`[@dialectlabs/blinks] Failed to lookup interstitial for URL: ${url}`,
112+
e,
113+
);
106114
return null;
107115
}
108116
}
@@ -167,15 +175,18 @@ async function fetchActionsRegistryConfig(): Promise<ActionsRegistryConfig> {
167175

168176
if (!response.ok) {
169177
console.error(
170-
'Failed to fetch actions registry config',
178+
'[@dialectlabs/blinks] Failed to fetch actions registry config',
171179
await response.json(),
172180
);
173181
return { actions: [], interstitials: [], websites: [] };
174182
}
175183

176184
return await response.json();
177185
} catch (e) {
178-
console.error('Failed to fetch actions registry config', e);
186+
console.error(
187+
'[@dialectlabs/blinks] Failed to fetch actions registry config',
188+
e,
189+
);
179190
return { actions: [], interstitials: [], websites: [] };
180191
}
181192
}

src/react/useAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function useAction(
2626
Action.fetch(actionUrl)
2727
.then(setAction)
2828
.catch((e) => {
29-
console.error('Failed to fetch action', e);
29+
console.error('[@dialectlabs/blinks] Failed to fetch action', e);
3030
setAction(null);
3131
});
3232
}, [actionUrl, isRegistryLoaded]);

src/react/useActionRegistryInterval.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function useActionsRegistryInterval({
2828
return () => {
2929
clearInterval(interval);
3030
};
31-
}, [isRegistryLoaded, refreshInterval]);
31+
}, [isLoading, isRegistryLoaded, refreshInterval]);
3232

3333
return { isRegistryLoaded };
3434
}

src/utils/interstitial-url.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export function isInterstitial(url: string | URL): IsInterstitialResult {
3636
decodedActionUrl: decodedActionUrlObj.toString(),
3737
};
3838
} catch (e) {
39-
console.error(`Failed to check if URL is interstitial: ${url}`, e);
39+
console.error(
40+
`[@dialectlabs/blinks] Failed to check if URL is interstitial: ${url}`,
41+
e,
42+
);
4043
return { isInterstitial: false };
4144
}
4245
}

0 commit comments

Comments
 (0)