Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split logging integration from error capturing #1608

Open
bitsandfoxes opened this issue Apr 5, 2024 · 5 comments · May be fixed by #1965
Open

Split logging integration from error capturing #1608

bitsandfoxes opened this issue Apr 5, 2024 · 5 comments · May be fixed by #1965

Comments

@bitsandfoxes
Copy link
Contributor

We switched from hooking into Application.logMessageReceived to setting ourselves up as a loghandler via Debug.unitylogger.logHandler = this;
This also means that we have to format the message ourselves which has a non-insignificant impact on performance

@bitsandfoxes
Copy link
Contributor Author

We switched from Application.logMessageReceived to Debug.unitylogger.logHandler to get access to the actual exception object to hand that to the IL2CPP backend to provide line number support for caught and uncaught exceptions. We previously had our own string parsing functionality to turn the string stacktrace into a SentryStacktrace.

Maybe we can split this into two? Keep relying on the unitylogger for actual exceptions but set up the Application.logMessageReceived so that messages at least get a stacktrace (even without linenumbers for now). What do you think @munkiki7?

@munkiki7
Copy link
Contributor

@bitsandfoxes , if Debug.unitylogger.logHandler is only actually useful for getting the exception, and is heavier in performance, then sure, we can only use it in that one place.

@github-project-automation github-project-automation bot moved this to Done in GDX May 14, 2024
@munkiki7 munkiki7 reopened this May 14, 2024
@bitsandfoxes bitsandfoxes moved this from Done to Todo in GDX May 14, 2024
@bitsandfoxes bitsandfoxes changed the title Performance degrades during high amounts of logs Split logging integration from error capturing May 23, 2024
@WeiLingQiang
Copy link

Is there any conclusion to this discussion? Can we use the method of monitoring Application.logMessageReceived instead of using Debug.unitylogger.logHandler = this;

Because there will be an extra line of useless information in the printed stack information: Sentry.Unity.Integrations.UnityLogHandlerIntegration:LogFormat(LogType, Object, String, Object[])
This is a very bad experience

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jul 4, 2024
@bitsandfoxes
Copy link
Contributor Author

Not yet. But I'd really like to see this happen.

@bitsandfoxes
Copy link
Contributor Author

We've not forgotten about this and have it on the roadmap.

@bitsandfoxes bitsandfoxes linked a pull request Jan 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants