MCPcopy Create free account
hub / github.com/GCWing/BitFun / forward

Function forward

src/web-ui/src/shared/utils/logger.ts:108–132  ·  view source on GitHub ↗
(
    kind: 'log' | 'debug' | 'info' | 'warn' | 'error' | 'trace',
    args: unknown[]
  )

Source from the content-addressed store, hash-verified

106 };
107
108 const forward = (
109 kind: 'log' | 'debug' | 'info' | 'warn' | 'error' | 'trace',
110 args: unknown[]
111 ) => {
112 if ((CONSOLE_KIND_LEVEL[kind] ?? LogLevel.INFO) < consoleForwardMinLevel) return;
113 const msg = `[console] ${formatConsoleArgs(args)}`;
114 switch (kind) {
115 case 'log':
116 case 'info':
117 void tauriInfo(msg).catch(() => {});
118 break;
119 case 'debug':
120 void tauriDebug(msg).catch(() => {});
121 break;
122 case 'trace':
123 void tauriTrace(msg).catch(() => {});
124 break;
125 case 'warn':
126 void tauriWarn(msg).catch(() => {});
127 break;
128 case 'error':
129 void tauriError(msg).catch(() => {});
130 break;
131 }
132 };
133
134 c.log = (...args: unknown[]) => {
135 forward('log', args);

Callers 1

Calls 1

formatConsoleArgsFunction · 0.85

Tested by

no test coverage detected