Tend your corner of the atmosphere. spores.garden turns your AT Protocol records into a personal site with unique themes. Your data never leaves your PDS. Grow something that's truly yours.
spores.garden
1const DEBUG_QUERY_PARAM = 'debug';
2const DEBUG_STORAGE_KEY = 'spores.garden.debug';
3
4function queryDebugEnabled(): boolean {
5 try {
6 const params = new URLSearchParams(window.location.search);
7 const value = params.get(DEBUG_QUERY_PARAM);
8 return value === '1' || value === 'true';
9 } catch {
10 return false;
11 }
12}
13
14function storageDebugEnabled(): boolean {
15 try {
16 return localStorage.getItem(DEBUG_STORAGE_KEY) === '1';
17 } catch {
18 return false;
19 }
20}
21
22export function isDebugLoggingEnabled(): boolean {
23 return queryDebugEnabled() || storageDebugEnabled();
24}
25
26export function debugLog(...args: unknown[]): void {
27 if (isDebugLoggingEnabled()) {
28 console.log(...args);
29 }
30}