allow debug from config

allow debug to be set from config at config.settings.debug as with same options as argument
This commit is contained in:
mstrhakr 2022-09-05 21:44:53 -04:00
parent b62e555c58
commit c4fb0c23e1

View File

@ -796,9 +796,13 @@ function CreateMeshCentralServer(config, args) {
}
// Local console tracing
if (typeof obj.args.debug == 'string') { obj.debugSources = obj.args.debug.toLowerCase().split(','); }
else if (typeof obj.args.debug == 'object') { obj.debugSources = obj.args.debug; }
else if (obj.args.debug === true) { obj.debugSources = '*'; }
var debugOptions = [obj.args.debug];
if (config.settings.debug) { debugOptions.push(config.settings.debug) }
debugOptions.forEach((option) => {
if (typeof option == 'string') { obj.debugSources = option.toLowerCase().split(','); }
else if (typeof option == 'object') { obj.debugSources = option; }
else if (option === true) { obj.debugSources = '*'; }
});
require('./db.js').CreateDB(obj,
function (db) {