microsoft / testfx

MSTest framework and adapter
MIT License
724 stars 254 forks source link

Use logger interface and not EqtTrace logger #2140

Open Evangelink opened 8 months ago

Evangelink commented 8 months ago

Summary

MSTest is currently using eqt trace logger everywhere for technical logs. This is preventing any logs to be produced when working in runner mode. There is also many limitations to how EqtTrace works that can cause locks and slowness.

Instead we should flow some interface and change the logger based on the actual runner.

nohwnd commented 8 months ago

more reasoning for history:

vstest/src/Microsoft.TestPlatform.PlatformAbstractions/common/Tracing/PlatformEqtTrace.cs at main · microsoft/vstest (github.com) It is probably for the best if you replace all the references to eqttrace in mstest with a logger interface that will forward to eqttrace, and that is defined in mstest.framework.

1) eqttrace is in objectmodel, and so this logging is only available to adapter, instead it should be available everywhere in mstest, so we can log any info from anywhere. 2) eqttrace owns the file and rolls it when it reaches given size. and it also won't allow writing into the file from multiple places without lock issues.