This commit is contained in:
James Newton-King 2018-04-16 09:03:01 +12:00
parent 75ade2d674
commit aec323d8d2
No known key found for this signature in database
GPG Key ID: 0A66B2F456BF5526
2 changed files with 12 additions and 13 deletions

View File

@ -5,12 +5,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Threading; using System.Threading;
using System.Threading.Channels; using System.Threading.Channels;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Http.Connections; using Microsoft.AspNetCore.Http.Connections;
using Microsoft.AspNetCore.Http.Connections.Client; using Microsoft.AspNetCore.Http.Connections.Client;
using Microsoft.AspNetCore.SignalR.Internal;
using Microsoft.AspNetCore.SignalR.Protocol; using Microsoft.AspNetCore.SignalR.Protocol;
using Microsoft.AspNetCore.SignalR.Tests; using Microsoft.AspNetCore.SignalR.Tests;
using Microsoft.AspNetCore.Testing.xunit; using Microsoft.AspNetCore.Testing.xunit;
@ -429,7 +431,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "FailedInvokingHubMethod"; writeContext.EventId.Name == "FailedInvokingHubMethod";
} }
@ -463,7 +465,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "UnknownHubMethod"; writeContext.EventId.Name == "UnknownHubMethod";
} }
@ -496,7 +498,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "FailedInvokingHubMethod"; writeContext.EventId.Name == "FailedInvokingHubMethod";
} }
@ -529,7 +531,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "FailedInvokingHubMethod"; writeContext.EventId.Name == "FailedInvokingHubMethod";
} }
@ -562,7 +564,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "UnknownHubMethod"; writeContext.EventId.Name == "UnknownHubMethod";
} }
@ -596,7 +598,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "FailedInvokingHubMethod"; writeContext.EventId.Name == "FailedInvokingHubMethod";
} }
@ -631,7 +633,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "FailedInvokingHubMethod"; writeContext.EventId.Name == "FailedInvokingHubMethod";
} }
@ -665,7 +667,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "NonStreamingMethodCalledWithStream"; writeContext.EventId.Name == "NonStreamingMethodCalledWithStream";
} }
@ -698,7 +700,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "StreamingMethodCalledWithInvoke"; writeContext.EventId.Name == "StreamingMethodCalledWithInvoke";
} }
@ -731,7 +733,7 @@ namespace Microsoft.AspNetCore.SignalR.Client.FunctionalTests
{ {
bool ExpectedErrors(WriteContext writeContext) bool ExpectedErrors(WriteContext writeContext)
{ {
return //writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" && return writeContext.LoggerName == "Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher" &&
writeContext.EventId.Name == "InvalidReturnValueFromStreamingMethod"; writeContext.EventId.Name == "InvalidReturnValueFromStreamingMethod";
} }

View File

@ -13,13 +13,11 @@ namespace Microsoft.AspNetCore.SignalR.Tests
private readonly ILoggerFactory _loggerFactory; private readonly ILoggerFactory _loggerFactory;
private readonly IDisposable _wrappedDisposable; private readonly IDisposable _wrappedDisposable;
private readonly ConcurrentDictionary<string, ILogger> _loggers; private readonly ConcurrentDictionary<string, ILogger> _loggers;
//private readonly ILogger _logger;
public ServerLogScope(ServerFixture serverFixture, ILoggerFactory loggerFactory, IDisposable wrappedDisposable) public ServerLogScope(ServerFixture serverFixture, ILoggerFactory loggerFactory, IDisposable wrappedDisposable)
{ {
_serverFixture = serverFixture; _serverFixture = serverFixture;
_loggerFactory = loggerFactory; _loggerFactory = loggerFactory;
//_logger = loggerFactory.CreateLogger(typeof(ServerLogScope));
_wrappedDisposable = wrappedDisposable; _wrappedDisposable = wrappedDisposable;
_loggers = new ConcurrentDictionary<string, ILogger>(StringComparer.Ordinal); _loggers = new ConcurrentDictionary<string, ILogger>(StringComparer.Ordinal);
@ -30,7 +28,6 @@ namespace Microsoft.AspNetCore.SignalR.Tests
{ {
var logger = _loggers.GetOrAdd(logRecord.Write.LoggerName, loggerName => _loggerFactory.CreateLogger(loggerName)); var logger = _loggers.GetOrAdd(logRecord.Write.LoggerName, loggerName => _loggerFactory.CreateLogger(loggerName));
logger.Log(logRecord.Write.LogLevel, logRecord.Write.EventId, logRecord.Write.State, logRecord.Write.Exception, logRecord.Write.Formatter); logger.Log(logRecord.Write.LogLevel, logRecord.Write.EventId, logRecord.Write.State, logRecord.Write.Exception, logRecord.Write.Formatter);
//_logger.Log(logRecord.Write.LogLevel, logRecord.Write.EventId, logRecord.Write.State, logRecord.Write.Exception, logRecord.Write.Formatter);
} }
public void Dispose() public void Dispose()