serilog-contrib / serilog-sinks-richtextbox

A Serilog sink that writes log events to a WPF RichTextBox control with colors and theme support
Apache License 2.0
107 stars 25 forks source link

Logging a null character causes an exception #77

Open eemitev opened 1 year ago

eemitev commented 1 year ago

Serilog appears to handle NULL characters fine but printing it to a RichTextBox causes an issue. If there is a NULL character in a string that is being logged, we end up with an unhandled exception.

msg = "\0";
Log.Information("{msg}", msg);
augustoproiete commented 1 year ago

@eemitev Does the Console sink support NULL characters? What would would you expect to see on the RichTextBox for non-printable characters like these?

eemitev commented 1 year ago

The Console Sink appears to print garbage instead of the NULL character. My expectation would be to get a Unicode Symbol. Specifically U+2400 ␀ SYMBOL FOR NULL

patiqs commented 11 months ago

Same problem with some other chars like: Log.Information("\u0002"); Log.Information("\u0002");