frontend/src/log.ts
raw| 1 | /** |
| 2 | * Log various errors |
| 3 | * |
| 4 | * In the future, this might turn into a noop for production builds. |
| 5 | */ |
| 6 | export function log_error(...args: unknown[]): void { |
| 7 | console.error(...args); |
| 8 | } |
| 9 | |
| 10 | /** |
| 11 | * Assert some condition. |
| 12 | * |
| 13 | * In the future, this might turn into a noop for production builds. |
| 14 | */ |
| 15 | export function assert( |
| 16 | condition: boolean, |
| 17 | message: string, |
| 18 | ...extraArgs: unknown[] |
| 19 | ): void { |
| 20 | console.assert(condition, message, ...extraArgs); |
| 21 | } |