tycono 0.1.96-beta.48 → 0.1.96-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/tycono.ts +7 -13
- package/package.json +1 -1
package/bin/tycono.ts
CHANGED
|
@@ -219,19 +219,13 @@ async function startServerForTui(): Promise<void> {
|
|
|
219
219
|
const logFd = fs.openSync(logFile, 'a');
|
|
220
220
|
const logStream = fs.createWriteStream(logFile, { fd: logFd });
|
|
221
221
|
const origStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
222
|
-
|
|
223
|
-
//
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return true;
|
|
230
|
-
}) as any;
|
|
231
|
-
process.stderr.write = ((chunk: any, ...args: any[]) => {
|
|
232
|
-
logStream.write(typeof chunk === 'string' ? chunk : chunk.toString());
|
|
233
|
-
return true;
|
|
234
|
-
}) as any;
|
|
222
|
+
// Redirect console.log/console.error to log file (server output)
|
|
223
|
+
// But DO NOT intercept process.stdout.write — Ink needs full control
|
|
224
|
+
const origConsoleLog = console.log;
|
|
225
|
+
const origConsoleError = console.error;
|
|
226
|
+
console.log = (...args: unknown[]) => { logStream.write(args.join(' ') + '\n'); };
|
|
227
|
+
console.error = (...args: unknown[]) => { logStream.write(args.join(' ') + '\n'); };
|
|
228
|
+
console.warn = (...args: unknown[]) => { logStream.write(args.join(' ') + '\n'); };
|
|
235
229
|
const origLog = (...args: unknown[]) => origStdoutWrite(args.join(' ') + '\n');
|
|
236
230
|
|
|
237
231
|
const { createHttpServer } = await import('../src/api/src/create-server.js');
|