Skip to content

Conversation

Flash0ver
Copy link
Member

@Flash0ver Flash0ver commented Aug 15, 2025

Revising the Log{Level} methods of the Structured Logger.

Breaking Changes in [Experimental] features

-public void LogInfo(string template, object[]? parameters = null, Action<SentryLog>? configureLog = null)
+public void LogInfo(string template, params object[] parameters)
+public void LogInfo(Action<SentryLog> configureLog, string template, params object[] parameters)

No changes in functionality.
But enables the use of params by moving the configureLog parameter to the beginning in a new overload per Log{Level} method group.

Microsoft.Extensions.Logging chose a similar approach by "prepending" additional parameters in the overloads of the Log{Level} extension methods.

Docs

@Flash0ver Flash0ver self-assigned this Aug 15, 2025
@Flash0ver Flash0ver added the Logs label Aug 15, 2025
Copy link
Contributor

github-actions bot commented Aug 15, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 0d19dea

@Flash0ver
Copy link
Member Author

@sentry review

@Flash0ver Flash0ver marked this pull request as ready for review August 21, 2025 23:42

namespace Sentry;

public abstract partial class SentryStructuredLogger
Copy link
Member Author

Choose a reason for hiding this comment

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

note: made class partial and moved all overloads of the Log{Level} method groups to a separate document

cursor[bot]

This comment was marked as outdated.

Copy link
Collaborator

@jamescrosswell jamescrosswell left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants