diff options
author | 杨宇千 <crupest@outlook.com> | 2019-09-25 21:35:35 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-09-25 21:35:35 +0800 |
commit | 7c021c429ea77dffdd877c3e2a0bcf6e881a7285 (patch) | |
tree | 6badcfb14fd9fb17c6ae467e2a767b6d72a282e9 /Timeline.Tests/Helpers/MyTestLoggerFactory.cs | |
parent | 3e4405f016ec6cf56bc86577a4662f2fb8f03cc4 (diff) | |
download | timeline-7c021c429ea77dffdd877c3e2a0bcf6e881a7285.tar.gz timeline-7c021c429ea77dffdd877c3e2a0bcf6e881a7285.tar.bz2 timeline-7c021c429ea77dffdd877c3e2a0bcf6e881a7285.zip |
Init migration to dotnet core 3.0.0 .
Diffstat (limited to 'Timeline.Tests/Helpers/MyTestLoggerFactory.cs')
-rw-r--r-- | Timeline.Tests/Helpers/MyTestLoggerFactory.cs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Timeline.Tests/Helpers/MyTestLoggerFactory.cs b/Timeline.Tests/Helpers/MyTestLoggerFactory.cs index 40c6a77e..b9960378 100644 --- a/Timeline.Tests/Helpers/MyTestLoggerFactory.cs +++ b/Timeline.Tests/Helpers/MyTestLoggerFactory.cs @@ -1,14 +1,25 @@ -using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Logging.Testing;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Abstractions;
using Xunit.Abstractions;
namespace Timeline.Tests.Helpers
{
- public static class MyTestLoggerFactory
+ public static class Logging
{
- public static LoggerFactory Create(ITestOutputHelper outputHelper)
+ public static ILoggerFactory Create(ITestOutputHelper outputHelper)
{
- return new LoggerFactory(new[] { new XunitLoggerProvider(outputHelper) });
+ // TODO: Use test output.
+ return NullLoggerFactory.Instance;
+ }
+
+ public static IWebHostBuilder ConfigureTestLogging(this IWebHostBuilder builder)
+ {
+ builder.ConfigureLogging(logging =>
+ {
+ //logging.AddXunit(outputHelper);
+ });
+ return builder;
}
}
}
|