private void LogTestStartFinish(bool isStart) { var originalLogLevel = _loggerForStartFinish.Level; _loggerForStartFinish.Level = LogLevel.Information; _loggerForStartFinish.Scoped(ThisClassName).Info()?.Log( isStart ? "Starting test: {UnitTestDisplayName}..." : "Finished test: {UnitTestDisplayName}", TestDisplayName); _loggerForStartFinish.Level = originalLogLevel; }
private void LogProgress(string message) { var originalLogLevel = _loggerForStartFinish.LogLevelSwitch.Level; _loggerForStartFinish.LogLevelSwitch.Level = LogLevel.Information; _loggerForStartFinish.Scoped(ThisClassName) .Info() ?.Log(message, TestDisplayName); _loggerForStartFinish.LogLevelSwitch.Level = originalLogLevel; }