Skip to content

Commit

Permalink
Removed colons from logs for Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
n42k committed Sep 16, 2019
1 parent 8493913 commit da3fd79
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "brikkit",
"version": "1.0.1",
"version": "1.0.2",
"keywords": [],
"main": "server.js",
"author": "n42k",
Expand Down
8 changes: 6 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ execSync(`mkdir -p conf`);
execSync(`mkdir -p saved`);
execSync(`mkdir -p plugins`);

const dateString = (new Date()).toISOString();
const logFile = `logs/log_${dateString}.txt`;
const iso8601DateString = (new Date()).toISOString();

// remove colons from the date string; required for windows
const colonlessDateString = iso8601DateString.split(':').join('');

const logFile = `logs/log_${colonlessDateString}.txt`;
let stream = fs.createWriteStream(logFile, {flags:'a'});

const oldConsoleLog = console.log;
Expand Down

0 comments on commit da3fd79

Please sign in to comment.