Closed stevenon1003 closed 5 years ago
Can you extract it to a separate function? It's repeated 8 times 😅
func setPacketLevel (packet *Packet, level string) {
if Severity(level) != "" {
packet.Level = Severity(level)
}
}
// ...
setPacketLevel(packet, tags["level"])
@stevenon1003 upon the second reading, I just realized that all those packets are just sent through Capture
call, which already has a place for modifications like this.
Therefore, your whole PR, can be summarized to just adding this 3 lines below line 645 😅:
if Severity(captureTags["level"]) != "" {
packet.Level = Severity(captureTags["level"])
}
@stevenon1003 upon the second reading, I just realized that all those packets are just sent through
Capture
call, which already has a place for modifications like this.Therefore, your whole PR, can be summarized to just adding this 3 lines below line 645 😅:
if Severity(captureTags["level"]) != "" { packet.Level = Severity(captureTags["level"]) }
Thanks @kamilogorek , it is the first time for me to contribute in github / sentry library. Thanks for sharing your idea.
Awesome! Thanks for your contribution :)
Currently all sentry messages are ERROR level. To support "debug"/"info"/"warning"/"fatal", we can use tags parameter. Actually in Sentry UI panel, we can see "level" tag but the value is always "error" at this moment.
The change is backward compatible. If developer wants to use this new enhancement, here is an example: