logger func to better know when and where soemthing was logged

This commit is contained in:
Zutatensuppe 2021-04-13 20:18:41 +02:00
parent 37022eaa6d
commit 0c238dd9f1
10 changed files with 83 additions and 31 deletions

View file

@ -1,5 +1,8 @@
import fs from 'fs'
import Protocol from '../common/Protocol.js'
import { logger } from '../common/Util.js'
const log = logger('rewrite_logs')
const DATA_DIR = '../data'
@ -7,7 +10,7 @@ const filename = (gameId) => `${DATA_DIR}/log_${gameId}.log`
const rewrite = (gameId) => {
const file = filename(gameId)
console.log(file)
log.log(file)
if (!fs.existsSync(file)) {
return []
}