Skip to content

Commit

Permalink
Merge pull request #6240 from donker/depr-dnnlogger
Browse files Browse the repository at this point in the history
Deprecate DnnLogger
  • Loading branch information
david-poindexter authored Dec 6, 2024
2 parents 08c294c + 0cccf14 commit 60e0493
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
1 change: 0 additions & 1 deletion DNN Platform/DotNetNuke.Instrumentation/DnnLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace DotNetNuke.Instrumentation
{
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Web.Compilation;
Expand Down
6 changes: 4 additions & 2 deletions DNN Platform/DotNetNuke.Instrumentation/DnnLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ namespace DotNetNuke.Instrumentation
using System.Web.Compilation;
using System.Web.UI;

using DotNetNuke.Internal.SourceGenerators;
using log4net;
using log4net.Core;
using log4net.Repository;
using log4net.Util;

/// <summary>Please use LoggerSource.Instance as a more unit testable way to create loggers.</summary>
public sealed class DnnLogger : LoggerWrapperImpl
/// <summary>Obsolete, use <see cref="LoggerSource"/> instead.</summary>
[DnnDeprecated(9, 13, 7, "Use LoggerSource.Instance", RemovalVersion = 11)]
public sealed partial class DnnLogger : LoggerWrapperImpl
{
// add custom logging levels (below trace value of 20000)
private static Level levelLogInfo = new Level(10001, "LogInfo");
Expand Down
6 changes: 2 additions & 4 deletions DNN Platform/DotNetNuke.Instrumentation/LoggerSourceImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
namespace DotNetNuke.Instrumentation
{
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Security;
using System.Web;

using DotNetNuke.Internal.SourceGenerators;
using log4net;
using log4net.Config;
using log4net.Core;
Expand Down Expand Up @@ -47,7 +45,7 @@ private class Logger : LoggerWrapperImpl, ILog
// add custom logging levels (below trace value of 20000)
// internal static Level LevelLogInfo = new Level(10001, "LogInfo");
// internal static Level LevelLogError = new Level(10002, "LogError");
private readonly Type stackBoundary = typeof(DnnLogger);
private readonly Type stackBoundary = typeof(Logger);

internal Logger(ILogger logger, Type type)
: base(logger)
Expand Down
2 changes: 1 addition & 1 deletion DNN Platform/Library/Entities/Tabs/TabWorkflowTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace DotNetNuke.Entities.Tabs

internal class TabWorkflowTracker : ServiceLocator<ITabChangeTracker, TabWorkflowTracker>, ITabChangeTracker
{
private static readonly DnnLogger Logger = DnnLogger.GetClassLogger(typeof(TabWorkflowTracker));
private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(TabWorkflowTracker));
private readonly ITabController tabController;
private readonly IWorkflowEngine workflowEngine;
private readonly IWorkflowManager workflowManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@

namespace Dnn.EditBar.UI.Components
{
using System;

using DotNetNuke.Entities.Modules;
using DotNetNuke.Instrumentation;

public class BusinessController : IUpgradeable
{
private static readonly DnnLogger Logger = DnnLogger.GetClassLogger(typeof(BusinessController));

/// <inheritdoc/>
public string UpgradeModule(string version)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Dnn.PersonaBar.Library.Controllers

public class PersonaBarController : ServiceLocator<IPersonaBarController, PersonaBarController>, IPersonaBarController
{
private static readonly DnnLogger Logger = DnnLogger.GetClassLogger(typeof(PersonaBarController));
private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(PersonaBarController));

private readonly IPersonaBarRepository personaBarRepository;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class MenuPermissionController

private const string ViewPermissionKey = "VIEW";

private static readonly DnnLogger Logger = DnnLogger.GetClassLogger(typeof(MenuPermissionController));
private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(MenuPermissionController));

private static readonly IDataService DataService = new DataService();
private static readonly object ThreadLocker = new object();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Dnn.PersonaBar.UI.Services
[MenuPermission(Scope = ServiceScope.Regular)]
public class MenuExtensionsController : PersonaBarApiController
{
private static readonly DnnLogger Logger = DnnLogger.GetClassLogger(typeof(MenuExtensionsController));
private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(MenuExtensionsController));

/// <summary>Retrieve a list of extensions for menu.</summary>
/// <returns>A response with a collection of extension info.</returns>
Expand Down

0 comments on commit 60e0493

Please sign in to comment.