Merge pull request #4508 from mstrhakr/allow-config-debug

Feature: Allow for debug options in config file.
This commit is contained in:
Ylian Saint-Hilaire 2022-09-05 22:13:15 -07:00 committed by GitHub
commit cd1a753e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) {