Move logs into log folder

This commit is contained in:
Adam Goldsmith 2019-07-11 18:08:43 -04:00
parent 6a755ec5af
commit 9ce49b5031
1 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ client.on("data", function(data) {
// ignore comments
let date = new Date();
fs.appendFile(
`log${datestamp(date)}.json`,
`log/log${datestamp(date)}.json`,
JSON.stringify([date, packet]) + "\n",
err => {
if (err) throw err;
@ -44,7 +44,7 @@ client.on("data", function(data) {
wss.on("connection", ws => {
let date = new Date();
fs.readFileSync(`log${datestamp(date)}.json`)
fs.readFileSync(`log/log${datestamp(date)}.json`)
.toString()
.split("\n")
.forEach(line => ws.send(line));