serilog-sinks-browserconsole icon indicating copy to clipboard operation
serilog-sinks-browserconsole copied to clipboard

Console styles improvements

Open GerkinDev opened this issue 3 years ago • 9 comments

Improve support for styles.

Since styles interpolation is made only on the 1st argument in console.log, this PR had to do a whole refactor of rendering process. 1st iteration converts Serilog tokens to console.log-aware tokens, that are then iterated to build the 1st parameter's string & following arguments.

Some tests included

GerkinDev avatar Jan 05 '22 16:01 GerkinDev

Oh, I had the exact same build error than the CI.

GerkinDev avatar Jan 05 '22 18:01 GerkinDev

I just found a way to implement the exact same behavior but much closer to your original implementation. Working on it.

GerkinDev avatar Jan 06 '22 06:01 GerkinDev

Here you are ! Feedbacks welcome

GerkinDev avatar Jan 06 '22 07:01 GerkinDev

Thanks for sending this. CI should be fixed now, so I'll close and reopen to trigger a build.

I'm not sure when I'll have time to review this one - will try to loop back ASAP, sorry!

nblumhardt avatar Jan 19 '22 05:01 nblumhardt

Hi, I've just spotted a couple of logical errors in my code while re-reviewing my PR. Unfortunately, I can't say if I'd be able to fix it soon since I've moved on non c# projects.

So, I guess I'll do another round on this. I'll take the opportunity to apply the feedbacks you will give me in the meantime.


Personal note here: I'm creating my business and I'm the only tech. It's been some time. If you had the time to make a proper peer review, this would be greatly appreciated. Working mostly alone has some unpleasant side effects. That's why I try to do as many PR as I can.

Have a nice day!

GerkinDev avatar Jan 21 '22 12:01 GerkinDev

This should be fixed now. Please review it, and tell me anything I should do to improve this PR. I think it could be merged.

GerkinDev avatar May 24 '22 13:05 GerkinDev

Hi @nblumhardt,

While I use the bin built from my fork in my main project, it would be nice to remove it and rely on the nuget package of your lib. There's absolutely no urge, I just want to ping you in case you forgot this PR is here.

Cheers !

GerkinDev avatar Oct 21 '22 13:10 GerkinDev

Thanks for the reminder @GerkinDev; I'm unfortunately not able to devote much time to this sink, currently (wondering whether any of the other Serilog maintainers might be spending more time with Blazor and have some thoughts on the direction we might go here? 🤔 )

If all else fails, releasing a fork from your repo (say, Serilog.Sinks.StyledBrowserConsole?) might help get the code to more users who would enjoy it.

nblumhardt avatar Oct 23 '22 03:10 nblumhardt

Hello, FYI I've rebased it and trimmed it a bit, just in case

GerkinDev avatar Oct 14 '24 14:10 GerkinDev