Skip to content

[code-simplifier] Apply Enabled() guards consistently to all logger calls in workflow_errors.go#27996

Merged
pelikhan merged 1 commit intomainfrom
simplify/logging-guards-workflow-errors-8fa4c177dd6d569f
Apr 23, 2026
Merged

[code-simplifier] Apply Enabled() guards consistently to all logger calls in workflow_errors.go#27996
pelikhan merged 1 commit intomainfrom
simplify/logging-guards-workflow-errors-8fa4c177dd6d569f

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

PR #27990 fixed the missing Enabled() guard on errorHelpersLog calls but the same file had the same issue on errorAggregationLog and sharedWorkflowLog calls.

Files Simplified

  • pkg/workflow/workflow_errors.go — added Enabled() guards to the remaining 5 unguarded logger calls

Improvements Made

Applied consistent logging guard pattern throughout the file:

Logger Before After
errorHelpersLog ✅ Fixed in #27990 ✅ Already fixed
errorAggregationLog ❌ 4 unguarded calls ✅ All guarded
sharedWorkflowLog ❌ 1 unguarded call ✅ Guarded

Unguarded log.Printf() calls pay the cost of formatting the string even when debug logging is disabled. The Enabled() guard prevents unnecessary string formatting, consistent with the project's zero-overhead logging philosophy documented in AGENTS.md.

Changes Based On

Recent changes from:

Testing

  • ✅ All related tests pass
  • ✅ Build succeeds (make build)
  • ✅ No functional changes — behavior is identical (guards are only skipped when debug logging is active)

Review Focus

Please verify all errorAggregationLog and sharedWorkflowLog calls now follow the same pattern as errorHelpersLog.

Generated by Code Simplifier · ● 1.4M ·

  • expires on Apr 24, 2026, 6:24 AM UTC

…rrors.go

PR #27990 fixed the missing Enabled() guard on errorHelpersLog calls.
Apply the same pattern consistently to errorAggregationLog and
sharedWorkflowLog calls in the same file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review April 23, 2026 06:26
Copilot AI review requested due to automatic review settings April 23, 2026 06:26
@pelikhan pelikhan merged commit d56bb05 into main Apr 23, 2026
16 of 19 checks passed
@pelikhan pelikhan deleted the simplify/logging-guards-workflow-errors-8fa4c177dd6d569f branch April 23, 2026 06:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR applies consistent Enabled() guards to remaining unguarded debug logger calls in workflow_errors.go, aligning errorAggregationLog and sharedWorkflowLog usage with the existing guarded errorHelpersLog pattern to avoid unnecessary logging-call overhead when debug logging is disabled.

Changes:

  • Wrapped 4 errorAggregationLog calls with if errorAggregationLog.Enabled() { ... }.
  • Wrapped 1 sharedWorkflowLog call with if sharedWorkflowLog.Enabled() { ... }.
  • Kept logging behavior unchanged when the relevant logger namespace is enabled.
Show a summary per file
File Description
pkg/workflow/workflow_errors.go Adds Enabled() guards around remaining debug logger calls for consistent, low-overhead logging behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants