Files
t3code/apps/mobile/src/features/terminal/terminalDebugLog.ts
T
b3e8c0334b T3 Code Mobile [WIP] (#2013)
Co-authored-by: codex <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
Co-authored-by: Yash Singh <[email protected]>
2026-05-29 17:00:54 -07:00

25 lines
779 B
TypeScript

/**
* Debug logging for the mobile terminal pipeline. Prefix: `[t3-terminal]`.
*
* Enabled when `__DEV__` is true, or set `globalThis.__T3_TERMINAL_DEBUG__ = true` in a JS
* debugger / Metro console to trace release/TestFlight builds.
*/
export function isTerminalDebugEnabled(): boolean {
return (
(typeof __DEV__ !== "undefined" && __DEV__) ||
(typeof globalThis !== "undefined" &&
(globalThis as { __T3_TERMINAL_DEBUG__?: boolean }).__T3_TERMINAL_DEBUG__ === true)
);
}
export function terminalDebugLog(message: string, data?: Record<string, unknown>): void {
if (!isTerminalDebugEnabled()) {
return;
}
if (data !== undefined) {
console.log(`[t3-terminal] ${message}`, data);
} else {
console.log(`[t3-terminal] ${message}`);
}
}