예제 #1
0
        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;
        }
예제 #2
0
        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;
        }