Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

cloudDebugLog.ts

18 lines499 Bytes

1export function isCloudDebugEnabled(): boolean {
2 return (
3 (typeof __DEV__ !== "undefined" && __DEV__) ||
4 (typeof globalThis !== "undefined" &&
5 (globalThis as { __V12_CLOUD_DEBUG__?: boolean }).__V12_CLOUD_DEBUG__ === true)
6 );
7}
8​
9export function cloudDebugLog(event: string, data?: Record<string, unknown>): void {
10 if (!isCloudDebugEnabled()) {
11 return;
12 }
13 if (data) {
14 console.log(`[v12-cloud] ${event}`, data);
15 } else {
16 console.log(`[v12-cloud] ${event}`);
17 }