mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added duplicate remover ( #5 ), saving subjects without year, file append now sync, minor logging improvements
This commit is contained in:
parent
be34113969
commit
e6db0f9175
4 changed files with 284 additions and 8 deletions
|
@ -87,9 +87,13 @@ function WriteFileAsync (content, path) {
|
|||
|
||||
function AppendToFile (data, file) {
|
||||
CreatePath(file)
|
||||
fs.appendFile(file, '\n' + data, function (err) {
|
||||
if (err) { logger.Log('Error writing log file: ' + file + ' (sync)', logger.GetColor('redbg')) }
|
||||
})
|
||||
try {
|
||||
fs.appendFileSync(file, '\n' + data)
|
||||
} catch (e) {
|
||||
logger.Log('Error appendig to file log file: ' + file + ' (sync)', logger.GetColor('redbg'))
|
||||
logger.Log(data)
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
function Beep () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue