From dcbbc607ae2114336a59d4d80dfbfc54f25941f9 Mon Sep 17 00:00:00 2001 From: Keith Cully Date: Thu, 1 Sep 2022 10:16:40 +0100 Subject: [PATCH] move to standard constant --- src/Logging/InitializationLogger.cs | 6 +++--- src/Logging/Microsoft.Omex.Extensions.Logging.csproj | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Logging/InitializationLogger.cs b/src/Logging/InitializationLogger.cs index de90f786..5f82e8dc 100644 --- a/src/Logging/InitializationLogger.cs +++ b/src/Logging/InitializationLogger.cs @@ -41,11 +41,11 @@ namespace Microsoft.Omex.Extensions.Logging public static void LogInitializationSucceed(string serviceNameForLogging, string message = "") { string logMessage = $"Initialization successful for {serviceNameForLogging}, {message}"; -#if Net_Standard +#if NET5_0_OR_GREATER + ServiceInitializationEventSource.Instance.LogHostBuildSucceeded(Environment.ProcessId, serviceNameForLogging, logMessage); +#else using Process process = Process.GetCurrentProcess(); ServiceInitializationEventSource.Instance.LogHostBuildSucceeded(process.Id, serviceNameForLogging, logMessage); -#else - ServiceInitializationEventSource.Instance.LogHostBuildSucceeded(Environment.ProcessId, serviceNameForLogging, logMessage); #endif Instance.LogInformation(Tag.Create(), logMessage); } diff --git a/src/Logging/Microsoft.Omex.Extensions.Logging.csproj b/src/Logging/Microsoft.Omex.Extensions.Logging.csproj index 970498a0..ac1066fc 100644 --- a/src/Logging/Microsoft.Omex.Extensions.Logging.csproj +++ b/src/Logging/Microsoft.Omex.Extensions.Logging.csproj @@ -2,9 +2,6 @@ $(LibraryTargetFrameworks) - - $(DefineConstants);Net_Standard - Microsoft.Omex.Extensions.Logging Microsoft Omex Extensions Logging