websocket-client icon indicating copy to clipboard operation
websocket-client copied to clipboard

Replaced LibLog with Ms Extension logging

Open k-u-s opened this issue 4 years ago • 4 comments

Resolves #46,

Replaced removed LibLock reference and added ILogger to ctors. If ILogger passed to ctor is null static ILoggerFactory instance is used to create logger.

Be default i think logger should be passed in ctor, but for easier migration to MS logger static factory was create.

Passing be ctor is used in sample project and static factory is used in Integration test project.

I was thinking about instead of using NullLoggerFactory checking if srilog or nlog or any other logger was initialed and use it but that would require reference to those projects which I wanted to avoid.

Because of that this PR is braking change. Migration step required for logger to work as excepted would be to initialize LogerFactory after configuring Logger as shown in

test_integration/Websocket.Client.Tests.Integration/WebsocketClientTests.cs line 247

or swith to ctor as shown in

test_integration/Websocket.Client.Sample/Program.cs line 50 to 55

Also updated dotnet projects to net core 3.1

k-u-s avatar Mar 31 '20 09:03 k-u-s

Hello @k-u-s,

thank you for the PR! Let me go through it, I will get back to you shortly.

Marfusios avatar Apr 01 '20 10:04 Marfusios

@Marfusios, can it be merged? LibLog is deprecated, and moreover, in the .NET Core world the ILogger abstraction is a way to go. Breaking change, in this case, is OK. Who wants to use the older logging approach will still use v4, who wants ILogger - will use new v5.

ruslanmogilevskiy avatar Sep 27 '21 20:09 ruslanmogilevskiy

What about this PR? I just need to disable logs, because of I use a lot of ws clients in my tests, and this provides good solution.

undron avatar Dec 08 '21 15:12 undron

I just merged master and resolved some conflicts. I am not sure about status, I forgot about it. Looking on conversation i do not see any pending request but i may be missing something.

k-u-s avatar Dec 08 '21 20:12 k-u-s

Implemented in 508e5472772a9ae229aeacbb5722f1672e5b7416

Marfusios avatar Sep 07 '23 07:09 Marfusios