Skip to content

Add logInfo, logWarn, logError functions to filter expressions#3131

Merged
sdottaka merged 2 commits into
masterfrom
feature/filter-expression-log-functions
Jan 11, 2026
Merged

Add logInfo, logWarn, logError functions to filter expressions#3131
sdottaka merged 2 commits into
masterfrom
feature/filter-expression-log-functions

Conversation

@sdottaka

@sdottaka sdottaka commented Jan 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds three logging functions (logInfo, logWarn, logError) to filter expressions for debugging purposes.

Changes

  • New Functions:

    • logInfo(value1, value2, ...) - logs at information level
    • logWarn(value1, value2, ...) - logs at warning level
    • logError(value1, value2, ...) - logs at error level
  • Features:

    • All arguments are converted to strings and concatenated with spaces
    • Returns the last argument value for use in filter expressions
    • Supports all value types including arrays, timestamps, file content refs

Usage Examples

  • // Log and check file size logInfo("File size:", Size) > 1MB
  • // Log processing with conditional Size > 1KB and logInfo("Large file:", Name) contains "test"
  • // Log with multiple values logWarn("Processing:", Name) like "*.tmp"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds three logging functions (logInfo, logWarn, logError) to WinMerge's filter expression system for debugging purposes. These functions concatenate and output their arguments to the log at different severity levels and return the last argument value, allowing them to be used inline within filter expressions.

Changes:

  • Added C++ implementation of logging functions with string conversion support for various value types
  • Updated logger signature to accept severity levels (error, warning, info)
  • Added comprehensive documentation in English, Japanese, and Hebrew

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Src/FilterEngine/FilterExpressionNodes.cpp Implements ToStringValue helper and three logging functions (LogError, LogWarn, LogInfo) with function registration
Src/FilterEngine/FilterExpression.h Updates logger signature to accept level parameter
Src/FilterEngine/FilterExpression.cpp Updates logger calls to include level parameter
Src/DirDoc.cpp Updates logger initialization to route messages by level
Translations/Docs/Manual/*.po Updates translation files with new line number references
Docs/Manual/*/Filters.xml Adds documentation for the new logging functions with examples

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

Comment thread Src/FilterEngine/FilterExpressionNodes.cpp Outdated
Comment thread Src/FilterEngine/FilterExpressionNodes.cpp Outdated
Comment thread Docs/Manual/Japanese/Filters.xml Outdated
Comment thread Docs/Manual/Hebrew/Filters.xml Outdated
Comment thread Docs/Manual/English/Filters.xml Outdated
Comment thread Src/FilterEngine/FilterExpressionNodes.cpp Outdated
@sdottaka sdottaka marked this pull request as ready for review January 11, 2026 02:30
@sdottaka sdottaka added this to the v2.16.54 milestone Jan 11, 2026
@sdottaka sdottaka merged commit 4f185d4 into master Jan 11, 2026
2 of 3 checks passed
@sdottaka sdottaka deleted the feature/filter-expression-log-functions branch January 11, 2026 02:35
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