Remove nameof for event name
This commit is contained in:
Andrew Stanton-Nurse 2019-06-04 07:56:14 -07:00 committed by GitHub
commit b9afd4a3b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 4 deletions

View File

@ -11,16 +11,28 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
{
// Category: DefaultHttpsProvider
private static readonly Action<ILogger, string, string, Exception> _locatedDevelopmentCertificate =
LoggerMessage.Define<string, string>(LogLevel.Debug, new EventId(0, nameof(LocatedDevelopmentCertificate)), "Using development certificate: {certificateSubjectName} (Thumbprint: {certificateThumbprint})");
LoggerMessage.Define<string, string>(
LogLevel.Debug,
new EventId(0, "LocatedDevelopmentCertificate"),
"Using development certificate: {certificateSubjectName} (Thumbprint: {certificateThumbprint})");
private static readonly Action<ILogger, Exception> _unableToLocateDevelopmentCertificate =
LoggerMessage.Define(LogLevel.Debug, new EventId(1, nameof(UnableToLocateDevelopmentCertificate)), "Unable to locate an appropriate development https certificate.");
LoggerMessage.Define(
LogLevel.Debug,
new EventId(1, "UnableToLocateDevelopmentCertificate"),
"Unable to locate an appropriate development https certificate.");
private static readonly Action<ILogger, string, Exception> _failedToLocateDevelopmentCertificateFile =
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(2, nameof(FailedToLocateDevelopmentCertificateFile)), "Failed to locate the development https certificate at '{certificatePath}'.");
LoggerMessage.Define<string>(
LogLevel.Debug,
new EventId(2, "FailedToLocateDevelopmentCertificateFile"),
"Failed to locate the development https certificate at '{certificatePath}'.");
private static readonly Action<ILogger, string, Exception> _failedToLoadDevelopmentCertificate =
LoggerMessage.Define<string>(LogLevel.Debug, new EventId(3, nameof(FailedToLoadDevelopmentCertificate)), "Failed to load the development https certificate at '{certificatePath}'.");
LoggerMessage.Define<string>(
LogLevel.Debug,
new EventId(3, "FailedToLoadDevelopmentCertificate"),
"Failed to load the development https certificate at '{certificatePath}'.");
public static void LocatedDevelopmentCertificate(this ILogger logger, X509Certificate2 certificate) => _locatedDevelopmentCertificate(logger, certificate.Subject, certificate.Thumbprint, null);