/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/ProjectTemplates/Shared/TestOutputLogger.cs
31 строка
788 B
Stephen Toub
Guard ILogger calls that do work at call site (#47837)
01 май 2023, 22:16
Не верифицирован
01 май 2023, 22:16
103560b
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Globalization; using Microsoft.Extensions.Logging; using Xunit.Abstractions; namespace Templates.Test.Helpers; internal sealed class TestOutputLogger : ITestOutputHelper { private readonly ILogger _logger; public TestOutputLogger(ILogger logger) { _logger = logger; } public void WriteLine(string message) { _logger.LogInformation(message); } public void WriteLine(string format, params object[] args) { if (_logger.IsEnabled(LogLevel.Information)) { _logger.LogInformation(string.Format(CultureInfo.InvariantCulture, format, args)); } } }