logger func to better know when and where soemthing was logged
This commit is contained in:
parent
37022eaa6d
commit
0c238dd9f1
10 changed files with 83 additions and 31 deletions
|
|
@ -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 []
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue