-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PlainTextFormatter is interpretting some objects as json that are not. #191
Comments
I was able to fix the issue by forking ZLogger and modifing MessageSequence.ToString line 265 to do Obviously it's not ideal to have to fork the entire project for this one line. If there was just some way to set an option or something that would prevent it from assuming Json... |
line 265 seems to be around IEnumerable, but is player an IEnumerable? |
Yes, player has a long object heirarchy but at it's base level it is a collection of attributes which inherits from IEnumerable |
Thank you. |
I'd just add ISpanFormattable for these Entities but Unity does not seem to support it, nor do I seem able to install it through NuGet for Unity, at least not Unity 2022.3.21f1. |
I see, in addition to ISpanFormattable, let's also add the IFormattable check. |
yeah that seems like it would work, thanks. |
When trying to log certain objects (though seemingly not all) we get an Internal exception:
Which comes from a line that looks like:
Debug.Logger.ZLogInformation($"[Match] AddPlayer({player} {player.AccountID})");
(errors on the
{player}
passed in).player is PlayerEntity class that inherits from an Entity class that is tagged as with
[Serializable]
if that helps.Entity implements a ToString override:
if I change the ZLogInformation line to
Debug.Logger.ZLogInformation($"[Match] AddPlayer({player.ToString()} {player.AccountID})");
everything works as expected.
Is there someway to tell the formatter to not "AppendAsJson" and just ToString an object? I've been trying to figure out how to make a custom formatter to do this but it seems like the actual issue is inside of the internal sealed class MessageSequence, where it does:
The text was updated successfully, but these errors were encountered: