Move logs into log folder
This commit is contained in:
parent
6a755ec5af
commit
9ce49b5031
@ -31,7 +31,7 @@ client.on("data", function(data) {
|
|||||||
// ignore comments
|
// ignore comments
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
fs.appendFile(
|
fs.appendFile(
|
||||||
`log${datestamp(date)}.json`,
|
`log/log${datestamp(date)}.json`,
|
||||||
JSON.stringify([date, packet]) + "\n",
|
JSON.stringify([date, packet]) + "\n",
|
||||||
err => {
|
err => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
@ -44,7 +44,7 @@ client.on("data", function(data) {
|
|||||||
|
|
||||||
wss.on("connection", ws => {
|
wss.on("connection", ws => {
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
fs.readFileSync(`log${datestamp(date)}.json`)
|
fs.readFileSync(`log/log${datestamp(date)}.json`)
|
||||||
.toString()
|
.toString()
|
||||||
.split("\n")
|
.split("\n")
|
||||||
.forEach(line => ws.send(line));
|
.forEach(line => ws.send(line));
|
||||||
|
Loading…
Reference in New Issue
Block a user