Skip to content

Loggers don't use latest writer #1586

@manfred-brands

Description

@manfred-brands

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.

Metadata

Metadata

Labels

BugV4All issues related to V4 or later - use -label:V4 to get V3 issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions