mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-05-12 15:09:06 -05:00
Added a bug report message to the start of the error log file
This commit is contained in:
@@ -4,11 +4,11 @@ const filePath = process.cwd() + "/data/logs/error.log";
|
||||
// Writes the errors into the error.log file
|
||||
module.exports = (error) => {
|
||||
const date = new Date().toLocaleString();
|
||||
const lineStarter = fs.existsSync(filePath) ? "\n\n" : "";
|
||||
const lineStarter = fs.existsSync(filePath) ? "\n\n" : "# Found a bug? Report it here: https://github.com/gnmyt/myspeed/issues\n\n";
|
||||
|
||||
fs.writeFile(filePath, lineStarter + "## " + date + "\n" + error, {flag: 'a+'}, err => {
|
||||
if (err) console.error("Could not save error log file.", error);
|
||||
});
|
||||
|
||||
process.exit(1);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user