Skip to content

Conversation

@rxlabz
Copy link
Contributor

@rxlabz rxlabz commented Oct 12, 2020

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Add a new Message class

💡 Motivation and Context

The Message Interface carries a log message that describes an event or error. Optionally, it can carry a format string and structured parameters. This can help to group similar messages into the same issue. cf. https://develop.sentry.dev/sdk/event-payloads/message/

fix #100

💚 How did you test it?

I updated the existing tests to verify all the message properties are correctly serialized

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

}

@override
bool operator ==(Object other) =>
Copy link
Member

Choose a reason for hiding this comment

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

We haven't been implementing these jn thr protocol. Is it really worth it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, I thought maybe it could in some tests, but the existing tests test the serialization equality, so I guess it's not necessary.

Comment on lines 27 to 37
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is Message &&
runtimeType == other.runtimeType &&
formatted == other.formatted &&
message == other.message &&
params == other.params;

@override
int get hashCode => formatted.hashCode ^ message.hashCode ^ params.hashCode;
Copy link
Contributor

@marandaneto marandaneto Oct 12, 2020

Choose a reason for hiding this comment

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

why do we need that if all the other protocols don't have it? unless we want to unit test references etc

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 thought about it, but as it's not done for now in the protocol, I removed them for now.

Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

LGTM

@rxlabz rxlabz merged commit e059012 into main Oct 12, 2020
@rxlabz rxlabz deleted the feature/event-message branch October 12, 2020 15:50
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.

Add logEntry to SentryEvent

4 participants