From b68b852c5561b65db0809b743dadaf2206f95f39 Mon Sep 17 00:00:00 2001 From: manushak Date: Tue, 20 Aug 2024 13:58:03 +0400 Subject: [PATCH 1/3] feat(config): add string for debug log --- src/if-run/config/strings.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/if-run/config/strings.ts b/src/if-run/config/strings.ts index 5ddabdecf..64ef8bde4 100644 --- a/src/if-run/config/strings.ts +++ b/src/if-run/config/strings.ts @@ -52,6 +52,8 @@ Note that for the '--output' option you also need to define the output type in y `Loading ${pluginName} from ${path}`, COMPUTING_PIPELINE_FOR_NODE: (nodeName: string) => `Running compute pipeline: \`${nodeName}\` plugin`, + COMPUTING_COMPONENT_PIPELINE: (component: string) => + `**Computing \`${component}\` pipeline**`, REGROUPING: 'Regrouping', OBSERVING: (nodeName: string) => `Running observe pipeline: \`${nodeName}\` plugin`, From 16c956d9940eb08c191bed8363439ccdbd3aa66f Mon Sep 17 00:00:00 2001 From: manushak Date: Tue, 20 Aug 2024 14:00:13 +0400 Subject: [PATCH 2/3] feat(util): update debug logic to accept exeption in formating message --- src/common/util/debug-logger.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common/util/debug-logger.ts b/src/common/util/debug-logger.ts index 74f7c7dbd..1a9a614d9 100644 --- a/src/common/util/debug-logger.ts +++ b/src/common/util/debug-logger.ts @@ -11,6 +11,7 @@ const logMessagesKeys: (keyof typeof STRINGS)[] = [ 'INITIALIZING_PLUGIN', 'LOADING_PLUGIN_FROM_PATH', 'COMPUTING_PIPELINE_FOR_NODE', + 'COMPUTING_COMPONENT_PIPELINE', 'REGROUPING', 'OBSERVING', 'MERGING_DEFAULTS_WITH_INPUT_DATA', @@ -110,9 +111,12 @@ const debugLog = (level: LogLevel, args: any[], debugMode: boolean) => { const date = new Date().toISOString(); const plugin = pluginNameManager.currentPluginName; - const formattedMessage = `${level}: ${date}: ${ - plugin ? plugin + ': ' : '' - }${args.join(', ')}`; + const isExeption = args[0].includes('**Computing'); + const message = `${level}: ${date}: ${plugin ? plugin + ': ' : ''}${args.join( + ', ' + )}`; + + const formattedMessage = isExeption ? args.join(', ') : message; if (debugMode) { switch (level) { From 0bcc16343486090d19c3e8ba41f6e0ed5d62c681 Mon Sep 17 00:00:00 2001 From: manushak Date: Tue, 20 Aug 2024 14:02:19 +0400 Subject: [PATCH 3/3] feat(lib): add debug log for tree components --- src/if-run/lib/compute.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/if-run/lib/compute.ts b/src/if-run/lib/compute.ts index b5558af92..805216768 100644 --- a/src/if-run/lib/compute.ts +++ b/src/if-run/lib/compute.ts @@ -18,6 +18,7 @@ const { EMPTY_PIPELINE, CONFIG_WARN, COMPUTING_PIPELINE_FOR_NODE, + COMPUTING_COMPONENT_PIPELINE, REGROUPING, OBSERVING, } = STRINGS; @@ -27,6 +28,7 @@ const { */ const traverse = async (children: any, params: ComputeParams) => { for (const child in children) { + console.debug(COMPUTING_COMPONENT_PIPELINE(child)); await computeNode(children[child], params); } };