From 9ce49b5031e392da34969813727d55a9ca109aa6 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 11 Jul 2019 18:08:43 -0400 Subject: [PATCH] Move logs into log folder --- src/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.js b/src/server.js index 1fc7145..a1afe8d 100644 --- a/src/server.js +++ b/src/server.js @@ -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));