Browse Source

Merged feature/file-logging into develop

shorten
benji7425 4 years ago
parent
commit
d8f583838e
  1. 1
      .gitignore
  2. 8
      log.js
  3. 1
      package.json

1
.gitignore

@ -1,3 +1,4 @@
log
# Created by https://www.gitignore.io/api/visualstudiocode,node

8
log.js

@ -1,4 +1,7 @@
var console = require("console");
var FileWriter = require("simple-file-writer");
var logWriter = new FileWriter("./log");
var latestLog = "";
@ -7,7 +10,10 @@ function log(message) {
latestLog = message; //spam reduction
//attach a formatted date string to the beginning of everything we log
console.log(new Date().toLocaleString() + " " + message);
var dateMessage = new Date().toLocaleString() + " " + message;
console.log(dateMessage);
logWriter.write(dateMessage + "\n");
}
}

1
package.json

@ -19,6 +19,7 @@
"dependencies": {
"discord.io": "^2.2.4",
"feed-read": "0.0.1",
"simple-file-writer": "^2.0.0",
"urijs": "^1.18.2"
}
}
Loading…
Cancel
Save