Layout - GetFormattedMessage with InvariantCulture#5777
Conversation
WalkthroughThis pull request updates the string conversion logic in the logging system. In the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant FormatHelper
participant Value
Caller->>FormatHelper: TryFormatToString(value, ?, formatProvider)
alt Value implements IConvertible
FormatHelper->>Value: convertible.ToString(formatProvider)
FormatHelper-->>Caller: formatted string
else Value is null
FormatHelper-->>Caller: null
else
FormatHelper->>Value: value?.ToString()
FormatHelper-->>Caller: formatted string
end
sequenceDiagram
participant FLR as FuncLayoutRenderer
participant L as Layout<T>
participant FH as FormatHelper
FLR->>FH: TryFormatToString(value, null, GetFormatProvider(logEvent, Culture))
L->>FH: TryFormatToString(objectValue, null, CultureInfo.InvariantCulture)
Assessment against linked issues
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (2)src/NLog/LayoutRenderers/FuncLayoutRenderer.cs (1)
src/NLog/Layouts/Typed/Layout.cs (3)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|



Resolves #5773 by always using InvariantCulture for both: