The InternalTrace class uses a static writer which is set in a call to Initialize.
Any caller that gets a ILogger before that call to Initialize is made gets a null writer.
InternalTrace.Initialize is called from TestEngine.Initialize.
Before a user can get there, the initializer of TestEngine has called new ServiceContext() which calls new ServiceManager() which calls InternalTrace.GetLogger(). This logger is called with the InternalTraceLevel.Default meaning it will never log anything.
If the user added any services before that call to TestEngine.Initialize none of them would every log either.
To solve this, the InternalTrace.GetLogger calls should not take the writer and DefaultTraceLevel when called, but the ones that are active.
The
InternalTraceclass uses astaticwriter which is set in a call toInitialize.Any caller that gets a
ILoggerbefore that call toInitializeis made gets anullwriter.InternalTrace.Initializeis called fromTestEngine.Initialize.Before a user can get there, the initializer of
TestEnginehas callednew ServiceContext()which callsnew ServiceManager()which callsInternalTrace.GetLogger(). This logger is called with theInternalTraceLevel.Defaultmeaning it will never log anything.If the user added any services before that call to
TestEngine.Initializenone of them would every log either.To solve this, the
InternalTrace.GetLoggercalls should not take the writer andDefaultTraceLevelwhen called, but the ones that are active.