From c4fb0c23e15c5a9fadbb38ef9b014c28a14e10ae Mon Sep 17 00:00:00 2001 From: mstrhakr <37352843+mstrhakr@users.noreply.github.com> Date: Mon, 5 Sep 2022 21:44:53 -0400 Subject: [PATCH] allow debug from config allow debug to be set from config at config.settings.debug as with same options as argument --- meshcentral.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/meshcentral.js b/meshcentral.js index 25624fbd..916ed515 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -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) {