add a title

This commit is contained in:
Tommy D. Rossi
2025-11-24 21:07:34 +01:00
parent ca93541e96
commit 394ae92db5
+4 -1
View File
@@ -7,13 +7,14 @@ import util from 'node:util'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const logFilePath = path.join(__dirname, '..', 'relay-server.log')
process.title = 'playwriter-ws-server'
fs.writeFileSync(logFilePath, '')
const log = (...args: any[]) => {
const message = args.map(arg =>
typeof arg === 'string' ? arg : util.inspect(arg, { depth: null, colors: false })
).join(' ')
fs.appendFileSync(logFilePath, message + '\n')
return fs.promises.appendFile(logFilePath, message + '\n')
}
const logger = {
@@ -21,6 +22,8 @@ const logger = {
error: log
}
export async function startServer({ port = 19988 }: { port?: number } = {}) {
const server = await startPlayWriterCDPRelayServer({ port, logger })