Skip to content

Bug 2013658 - Register for multiple tracing events#7202

Open
bendk wants to merge 1 commit intomozilla:mainfrom
bendk:push-tywwlwwsrwsu
Open

Bug 2013658 - Register for multiple tracing events#7202
bendk wants to merge 1 commit intomozilla:mainfrom
bendk:push-tywwlwwsrwsu

Conversation

@bendk
Copy link
Contributor

@bendk bendk commented Feb 3, 2026

Added a new register_event_sink method that registers event sinks using the new EventSinkSpecification struct. This is general enough that we can use it to implement the older registration methods.

This is a breaking change, but Desktop is the only platform that's will be affected. We can resolve the breakage when we do the next vendor.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

Added a new `register_event_sink` method that registers event sinks
using the new `EventSinkSpecification` struct.  This is general enough
that we can use it to implement the older registration methods.

This is a breaking change, but Desktop is the only platform that's will
be affected. We can resolve the breakage when we do the next vendor.
@bendk bendk requested a review from mhammond February 3, 2026 21:10
/// Register an event sink that will receive events based on a target/level pair.
///
/// Returns an [EventSinkId] that can be used to unregister the sink.
pub fn register_target_event_sink(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept these around since it was simple enough to continue to support them, but maybe we should remove them and encourage everyone to use the new API.

warn!(target: "third_target", extra=-4, "event message3");
info!(target: "third_target", extra=-5, "event message (should be filtered)");
// Matches both for first_target and for the min-level, it should only be received once by
// the sink
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main reason for this change. On Desktop, when I went to wire up the error-reporting code, I had issues because both the event's target matched and the min-level matched, so we were getting duplicate events and would be reporting each error twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant