Skip to main content
.NETStandard2.0

Microsoft.DependecyInjection extensions to add Vostok NUnit log.

Published
Jul 31, 2022
4y ago
Total Downloads
312
312

Install

dotnet add package Vostok.Logging.NUnit.DependencyInjection --version 1.0.0-pre000011
ProductVersions
.NET Standard
netstandard2.0

README

Vostok.Logging.NUnit

Build & Test & Publish NuGet

An implementation of ILog that writes log events to NUnit.

Build guide: https://github.com/vostok/devtools/blob/master/library-dev-conventions/how-to-build-a-library.md

User documentation: https://vostok.gitbook.io/logging/

Адаптер восточного лога для NUnit.

Логи могут быть записаны в:

  1. Контекст теста, который выполняется сейчас. Контекст берется из AsyncLocal. Подходит для стандартных тестов.
  2. В контекст теста, в котором был создан лог. Подходит, для локально поднятых сервисов и других мест, где AsyncLocal-контекст теряется или отсутствует).

  1. Запись лога в контекст теста, который выполняется сейчас:

а) ILog log = new NUnitTextWriterLog(new NUnitAsyncLocalTextWriterProvider());

б) serviceCollection.AddContextualNUnitLog()

  1. Запись лога в контекст теста, в котором был создан лог:

а) ILog log = new NUnitTextWriterLog(new NUnitTestContextTextWriterProvider(TestExecutionContext.CurrentContext));

б) serviceCollection.AddBoundNUnitLog()

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.