Skip to content

Commit

Permalink
Mark Serilog-related classes and properties [Obsolete]
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Feb 10, 2022
1 parent 9df0a94 commit 814af50
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class AdvancedLogger
/// <summary>
/// Gets or sets the Request logging mechanism.
/// </summary>
[System.Obsolete("Use Logger with TraceLogger or a custom implementation.")]
public RequestAdvancedLog RequestAdvancedLog { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public IppConfiguration GetConfiguration()
ippConfig.AdvancedLogger = new AdvancedLogger
{

#pragma warning disable CS0618 // Type or member is obsolete
RequestAdvancedLog = new RequestAdvancedLog()
{
EnableSerilogRequestResponseLoggingForDebug = false,
Expand All @@ -105,6 +106,7 @@ public IppConfiguration GetConfiguration()
EnableSerilogRequestResponseLoggingForFile = false,
ServiceRequestLoggingLocationForFile = System.IO.Path.GetTempPath()
}
#pragma warning restore CS0618 // Type or member is obsolete
};

if (ippConfigurationSection == null)
Expand Down Expand Up @@ -355,7 +357,8 @@ public IppConfiguration GetConfiguration()

ippConfig.AdvancedLogger = new AdvancedLogger
{


#pragma warning disable CS0618 // Type or member is obsolete
RequestAdvancedLog = new RequestAdvancedLog()
{
EnableSerilogRequestResponseLoggingForDebug = false,
Expand All @@ -364,6 +367,7 @@ public IppConfiguration GetConfiguration()
EnableSerilogRequestResponseLoggingForFile = false,
ServiceRequestLoggingLocationForFile = System.IO.Path.GetTempPath()
}
#pragma warning restore CS0618 // Type or member is obsolete
};


Expand Down Expand Up @@ -481,6 +485,7 @@ public IppConfiguration GetConfiguration()

#endregion

#pragma warning disable CS0618 // Type or member is obsolete
if (!string.IsNullOrEmpty(serilogLoggerSettingsFile["LogDirectory"]) && Convert.ToBoolean(serilogLoggerSettingsFile["EnableLogs"]) == true)
{

Expand All @@ -499,6 +504,7 @@ public IppConfiguration GetConfiguration()
ippConfig.AdvancedLogger.RequestAdvancedLog.ServiceRequestLoggingLocationForFile = serilogLoggerSettingsFile["LogDirectory"];

}
#pragma warning restore CS0618 // Type or member is obsolete

//old logger
if (!string.IsNullOrEmpty(loggerSettings["LogDirectory"]) && Convert.ToBoolean(loggerSettings["EnableLogs"]) == true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public MemoryConfigurationProvider(IppConfiguration cfg)
cfg.AdvancedLogger = new AdvancedLogger
{

#pragma warning disable CS0618 // Type or member is obsolete
RequestAdvancedLog = new RequestAdvancedLog()
{
EnableSerilogRequestResponseLoggingForDebug = false,
Expand All @@ -65,6 +66,7 @@ public MemoryConfigurationProvider(IppConfiguration cfg)
EnableSerilogRequestResponseLoggingForFile = false,
ServiceRequestLoggingLocationForFile = System.IO.Path.GetTempPath()
}
#pragma warning restore CS0618 // Type or member is obsolete
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace Intuit.Ipp.Core.Configuration
/// <summary>
/// Contains properties used to indicate whether request and response messages are to be logged.
/// </summary>
[Obsolete("Serilog configuration for Advanced Logging deprecated.")]
public class RequestAdvancedLog
{
/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions IPPDotNetDevKitCSV3/Code/Intuit.Ipp.Core/CoreHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public static Diagnostics.IAdvancedLogger GetAdvancedLogging(ServiceContext serv
return requestLogger;
}

#pragma warning disable CS0618 // Type or member is obsolete
if (serviceContext.IppConfiguration != null &&
serviceContext.IppConfiguration.AdvancedLogger != null &&
serviceContext.IppConfiguration.AdvancedLogger.RequestAdvancedLog != null)
Expand All @@ -215,6 +216,9 @@ public static Diagnostics.IAdvancedLogger GetAdvancedLogging(ServiceContext serv
{
requestLogger = new Diagnostics.AdvancedLogging(enableSerilogRequestResponseLoggingForDebug: true, enableSerilogRequestResponseLoggingForTrace: true, enableSerilogRequestResponseLoggingForConsole: true, enableSerilogRequestResponseLoggingForFile: false, serviceRequestLoggingLocationForFile: null);
}
#pragma warning restore CS0618 // Type or member is obsolete

requestLogger.Log("Advanced Logging with Serilog is deprecated.");

return requestLogger;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace Intuit.Ipp.Diagnostics
/// <summary>
/// Contains properties used to indicate whether request and response messages are to be logged.
/// </summary>
[Obsolete("Use TraceLogger or a custom implementation.")]
public class AdvancedLogging : IAdvancedLogger
{
/// <summary>
Expand Down

0 comments on commit 814af50

Please sign in to comment.