Skip to content

Add (default:) string interpolation overloads#471

Merged
kukushechkin merged 1 commit into
apple:mainfrom
kukushechkin:add-default-interpolation-for-metadata-value
Jun 9, 2026
Merged

Add (default:) string interpolation overloads#471
kukushechkin merged 1 commit into
apple:mainfrom
kukushechkin:add-default-interpolation-for-metadata-value

Conversation

@kukushechkin

Copy link
Copy Markdown
Contributor

Add Default String Interpolation overloads for MetadataValue to restore compatibility with \(default:) interpolation.

Motivation:

1.13.0 introduced a breaking change to the default string interpolation compatibility. We do not want to revert the custom string interpolation, but can fix compatibility with the default string interpolation as much as possible.

Modifications:

Add \(default:) overloads to MetadataValue.StringInterpolation, similar to the once in DefaultStringInterpolation.

Result:

Compatibility with logger.info("Log message", metadata: ["value": "\(value, default: "none")"]) is restored.

@kukushechkin
kukushechkin merged commit 92448c3 into apple:main Jun 9, 2026
105 of 106 checks passed
@kukushechkin
kukushechkin deleted the add-default-interpolation-for-metadata-value branch June 11, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants