mirror of
https://github.com/Ride-The-Lightning/RTL
synced 2024-11-11 13:10:41 +00:00
794c2ad5d9
MultiNode Ready for Testing
30 lines
829 B
JavaScript
30 lines
829 B
JavaScript
var fs = require('fs');
|
|
var common = require('../common');
|
|
|
|
exports.info = (msgStr, selNode = common.selectedNode) => {
|
|
if (msgStr.indexOf('Config Setup Variable') === -1) {
|
|
console.log('Console: ' + msgStr);
|
|
}
|
|
if(selNode.enable_logging) {
|
|
fs.appendFile(selNode.log_file, msgStr, function(err) {
|
|
if (err) {
|
|
return ({ error: 'Updating Log Failed!' });
|
|
} else {
|
|
return ({ message: 'Log Updated Successfully' });
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
exports.error = (msgStr, selNode = common.selectedNode) => {
|
|
console.error('Console: ' + msgStr);
|
|
if(selNode.enable_logging) {
|
|
fs.appendFile(selNode.log_file, msgStr, function(err) {
|
|
if (err) {
|
|
return ({ error: 'Updating Log Failed!' });
|
|
} else {
|
|
return ({ message: 'Log Updated Successfully' });
|
|
}
|
|
});
|
|
}
|
|
} |