Skip to content

Conversation

jonashouben
Copy link
Contributor

Fixes #207.

The issue are this lines in RpcConnection. When either the Exception Message, or the Stacktrace contains a brace (for example "{").

grafik

I fixed it like in the FileLogger - only use the formatted version, when arguments are actually provided.

@dowmeister
Copy link

hey @jonashouben , thank you from the community :)

Are you able to reproduce? is it an error related to a Discord update or something? I've tried to reproduce but on many clients works correctly.
Just curious to know from what is caused

@jonashouben
Copy link
Contributor Author

hey @jonashouben , thank you from the community :)

Are you able to reproduce? is it an error related to a Discord update or something? I've tried to reproduce but on many clients works correctly. Just curious to know from what is caused

Unfortunately not. As written by others in the issue, it only happens for some users. But I'm relatively sure it's the exception message, because that's the only place in MainLoop where it can cause the logger to throw.

@jonashouben
Copy link
Contributor Author

@shardick maybe to clarify. The PR is fixing only the logging, not the logged error :)

Copy link

@Bl0n Bl0n left a comment

Choose a reason for hiding this comment

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

I had a user for which this issue constantly crashed the app. With this fix implemented, the issue is fully resolved for this user.

I have no idea what caused the underlying problem, as I didn't change anything to my code since September 12th, and these crashes started on September 23rd. Probably a Discord update??? I've heard from both users of normal Discord and Discord Canary that this was occurring, but I have not been able to replicate the issue.

However, as mentioned, this proposed fix does seem to resolve the issue.

@Lachee Lachee merged commit f641367 into Lachee:master Oct 2, 2022
@Lachee
Copy link
Owner

Lachee commented Oct 2, 2022

Thank you for your contribution. The other loggers will be updated to match this before i push another release :)

@jonashouben
Copy link
Contributor Author

Hey @Lachee, thanks!

As far as I noticed, the other loggers already have this behavior:

FileLogger: args.Length > 0 ? string.Format(message, args) : message
NullLogger: Nothing logged

Phoenixx19 added a commit to JumpKingPlus/JumpKingPlus that referenced this pull request Oct 4, 2022
@Phoenixx19
Copy link

Thanks! :)

@Lachee
Copy link
Owner

Lachee commented Oct 18, 2022

Thank you for your contribution. This is now released in v1.1.1 ✨🌟 🎉

@jonashouben jonashouben deleted the console-format branch January 24, 2023 18:11
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.

[BUG] wrong format in Logging
5 participants