syntex-logger
Advanced tools
Comparing version 1.0.4-b3 to 1.0.4-b4
51
main.js
@@ -76,3 +76,3 @@ let LanguageSwitcher = require('./languages/language_switcher'); | ||
async log(level, id, letters, message) | ||
log(level, id, letters, message) | ||
{ | ||
@@ -130,3 +130,3 @@ var levels = ['debug', 'success', 'update', 'read', 'info', 'warn', 'error']; | ||
async err(error) | ||
err(error) | ||
{ | ||
@@ -140,3 +140,3 @@ var s = (error.stack.split('\n')[1].split('\n')[0].match(/\//g) || []).length; | ||
async debug(message) | ||
debug(message) | ||
{ | ||
@@ -247,28 +247,33 @@ this.log('debug', 'bridge', 'Bridge', message); | ||
async function saveLog(level, id, letters, time, message) | ||
function saveLog(level, id, letters, time, message) | ||
{ | ||
if(allLogs[id] == null) | ||
{ | ||
allLogs[id] = {}; | ||
} | ||
return new Promise((resolve) => { | ||
if(allLogs[id][letters] == null) | ||
{ | ||
allLogs[id][letters] = []; | ||
} | ||
if(allLogs[id] == null) | ||
{ | ||
allLogs[id] = {}; | ||
} | ||
removeExpired(); | ||
if(allLogs[id][letters] == null) | ||
{ | ||
allLogs[id][letters] = []; | ||
} | ||
allLogs[id][letters].push({ t : time, l : level, m : message }); | ||
removeExpired(); | ||
if(ready) | ||
{ | ||
logs.add(allLogs, (err) => { | ||
allLogs[id][letters].push({ t : time, l : level, m : message }); | ||
if(err) | ||
{ | ||
logger.log('error', 'bridge', 'Bridge', prefix + '.json %update_error%! ' + err); // REMOVE? | ||
} | ||
}); | ||
} | ||
if(ready) | ||
{ | ||
logs.add(allLogs, (err) => { | ||
resolve(); | ||
if(err) | ||
{ | ||
logger.log('error', 'bridge', 'Bridge', prefix + '.json %update_error%! ' + err); // REMOVE? | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
@@ -275,0 +280,0 @@ |
{ | ||
"name": "syntex-logger", | ||
"version": "1.0.4-b3", | ||
"version": "1.0.4-b4", | ||
"description": "A Basic Logging System", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13501
355