Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

feat: add auto generate breadcrumb option#8

Merged
bruno-garcia merged 1 commit intogetsentry:mainfrom
uskey512:feature/add-auto-generate-breadcrumb-option
Feb 12, 2021
Merged

feat: add auto generate breadcrumb option#8
bruno-garcia merged 1 commit intogetsentry:mainfrom
uskey512:feature/add-auto-generate-breadcrumb-option

Conversation

@uskey512
Copy link
Contributor

@uskey512 uskey512 commented Feb 8, 2021

Automatically add non-error debug logs to breadcrumb list.

For many small and medium-sized games, being able to see the debug log just before errors in chronological order is effective for debugging.

This option adds simple information to the breadcrumb list without the programmer having to explicitly build it.

@bruno-garcia
Copy link
Member

I appreciate the contribution but I'm wary of extending this code base unless we start adding some tests and CI/CD. And at this time we're focusing on: https://github.com/getsentry/sentry-unity

That repo already stores messages as breadcrumbs.

Technically it's usable already via UPM even though it's not really tested yet:

https://github.com/getsentry/sentry-unity.git?path=/package#d240dbf7e8d81325ff84cc4df0a651463f6965c2

Would you be willing to give it a try? I wonder if what we're building there would work for you and we'd love feedback on it.

{
if (AutoGenerateBreadcrumb) // add non-errors to the breadcrumb list
{
AddBreadcrumb(condition);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to also add whether it was a warning or a regular log message? (not sure how the breadcrumb system works)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Warnings and regular log messages can also be added.
For example, if you use Debug.Log, you will get the following output.
(using PUN2)

スクリーンショット 2021-02-10 18 35 57

@johanhelsing
Copy link
Contributor

I'm still using sentry-unity-lite and have yet to try out sentry-unity. I think the benefits of merging this far outweighs the risk, and I'll probably maintain it in my own fork if it's not merged upstream.

Don't get me wrong, I do intend to try out sentry-unity eventually, I'm just wary of adding a big/complex/fairly new dependency to projects that are already live and using sentry-unity-lite.

@johanhelsing
Copy link
Contributor

It's also implemented as an opt-in feature, so shouldn't really affect existing users.

@uskey512
Copy link
Contributor Author

@bruno-garcia
I think your point about CI/CD is correct.
However, we have extended it in a way that does not affect existing users, as there is currently no testing throughout.
(PR that would add CI/CD from scratch is difficult for a mere contributor).

Thanks for the information about sentry-unity.
I checked the internals to read the source, but it seemed a bit large with a lot of dll files and such, so I think I will use sentry-unity-lite for the current project.

@bruno-garcia
Copy link
Member

I checked the internals to read the source, but it seemed a bit large with a lot of dll files and such, so I think I will use sentry-unity-lite for the current project.

This is what I really want to clarify with folks. The fact it's DLLs just means you dn't need to compile C# into DLL with your game. The actual final size increase we still need to investigate futher but with AOT and the linker dropping what's not used it shoudn't be an issue, but agree we need to check.

I'll merge this though, makes sense to add. But it'll be hard to maintain two SDKs.

@bruno-garcia bruno-garcia merged commit 87fb540 into getsentry:main Feb 12, 2021
@uskey512
Copy link
Contributor Author

Thanks Marge.
I will use "sentry-unity" for my next project.

@bruno-garcia
Copy link
Member

Really appreciate the help here, and with testing it there as we invest further on it.
The earlier we identify any blockers, the quicker we can address them without going further on the wrong direction. 🙏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants