Major logging changes

This commit is contained in:
YourFriendlyNeighborhoodDealer 2019-03-24 10:06:28 +01:00
parent fbf5a99cfd
commit fde527aaeb
5 changed files with 83 additions and 78 deletions

View file

@ -59,7 +59,7 @@ function WriteFileAsync(content, path) {
CreatePath(path);
fs.writeFile(path, content, function(err) {
if (err) {
logger.Log("[ERR ]: Error writing file: " + path + " (sync)", logger.GetColor("redbg"));
logger.Log("Error writing file: " + path + " (sync)", logger.GetColor("redbg"));
}
});
}
@ -68,7 +68,7 @@ function AppendToFile(data, file) {
CreatePath(file);
fs.appendFile(file, "\n" + data, function(err) {
if (err)
logger.Log("[ERR ]: Error writing log file: " + file + " (sync)", logger.GetColor("redbg"));
logger.Log("Error writing log file: " + file + " (sync)", logger.GetColor("redbg"));
});
}
@ -84,7 +84,7 @@ function WriteBackup() {
try {
WriteFileAsync(ReadFile(dataFile), 'public/backs/data_' + new Date().toString());
} catch (e) {
logger.Log("[ERR ]: Error backing up data json file!", logger.GetColor("redbg"));
logger.Log("Error backing up data json file!", logger.GetColor("redbg"));
console.log(e);
}
}