From b3d2877f0a3344830be921cfae15082ed27009fd Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Tue, 9 Sep 2025 12:14:31 +0200 Subject: [PATCH] Enhanced debugging and reduce verbose config logs - Change trigger debugging from debug to info level for visibility - Add trigger condition evaluation logging with doc status - Reduce verbose plugin config logs that spam dev console - Help customer diagnose trigger matching issues more effectively --- src/core/workflow-executor.ts | 10 ++++++---- src/plugin/index.ts | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/workflow-executor.ts b/src/core/workflow-executor.ts index b8c6000..566b4bd 100644 --- a/src/core/workflow-executor.ts +++ b/src/core/workflow-executor.ts @@ -1029,7 +1029,7 @@ export class WorkflowExecutor { } }> - this.logger.debug({ + this.logger.info({ workflowId: workflow.id, workflowName: workflow.name, triggerCount: triggers?.length || 0, @@ -1090,7 +1090,7 @@ export class WorkflowExecutor { // Check trigger condition if present if (trigger.condition) { - this.logger.debug({ + this.logger.info({ collection, operation, condition: trigger.condition, @@ -1098,8 +1098,10 @@ export class WorkflowExecutor { docFields: doc ? Object.keys(doc) : [], previousDocId: (previousDoc as any)?.id, workflowId: workflow.id, - workflowName: workflow.name - }, 'Evaluating collection trigger condition') + workflowName: workflow.name, + docStatus: (doc as any)?.status, + previousDocStatus: (previousDoc as any)?.status + }, 'Evaluating trigger condition before execution') const conditionMet = this.evaluateCondition(trigger.condition, context) diff --git a/src/plugin/index.ts b/src/plugin/index.ts index 3dd042d..c1dab34 100644 --- a/src/plugin/index.ts +++ b/src/plugin/index.ts @@ -159,7 +159,7 @@ export const workflowsPlugin = } const collection = config.collections[collectionIndex] - logger.info(`Found collection '${triggerSlug}' - modifying its hooks...`) + logger.debug(`Found collection '${triggerSlug}' - modifying its hooks...`) // Initialize hooks if needed if (!collection.hooks) { @@ -266,7 +266,7 @@ export const workflowsPlugin = // Add the hook to the collection config collection.hooks.afterChange.push(automationHook) - logger.info(`Added automation hook to '${triggerSlug}' - hook count: ${collection.hooks.afterChange.length}`) + logger.debug(`Added automation hook to '${triggerSlug}' - hook count: ${collection.hooks.afterChange.length}`) } } @@ -275,7 +275,7 @@ export const workflowsPlugin = } const configLogger = getConfigLogger() - configLogger.info(`Configuring workflow plugin with ${Object.keys(pluginOptions.collectionTriggers || {}).length} collection triggers`) + configLogger.debug(`Configuring workflow plugin with ${Object.keys(pluginOptions.collectionTriggers || {}).length} collection triggers`) // Generate cron tasks for workflows with cron triggers generateCronTasks(config)