mirror of
https://github.com/DinheroDevelopmentGroup/modular-minecraft-proxy.git
synced 2024-11-27 09:35:49 -05:00
Better Logging
This commit is contained in:
parent
70d885c922
commit
42c6ad8822
2 changed files with 14 additions and 0 deletions
|
@ -12,6 +12,8 @@ export const server = createServer({
|
|||
})
|
||||
|
||||
server.on('login', client => {
|
||||
console.info(`${client.username} has connected!`)
|
||||
|
||||
// eslint-disable-next-line no-new
|
||||
new Instance(client)
|
||||
})
|
||||
|
|
|
@ -37,9 +37,21 @@ export class Instance {
|
|||
console.error('Target error:', error)
|
||||
})
|
||||
|
||||
console.info('Initializing worker... (local context)')
|
||||
|
||||
const start = performance.now()
|
||||
|
||||
const worker = new Worker(WORKER_PATH)
|
||||
this.worker = worker
|
||||
|
||||
worker.on('online', () => {
|
||||
const end = performance.now()
|
||||
|
||||
const delta = end - start
|
||||
|
||||
console.info(`Worker online! took ${delta.toFixed(2)}ms`)
|
||||
})
|
||||
|
||||
worker.on('error', error => {
|
||||
console.error('Worker error:', error)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue