mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Major logging changes
This commit is contained in:
parent
fbf5a99cfd
commit
fde527aaeb
5 changed files with 83 additions and 78 deletions
6
utils.js
6
utils.js
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue