From ef0bd16eab7fb5fa28d5b9cc32b2a744072dcefd Mon Sep 17 00:00:00 2001 From: Phil Dye Date: Tue, 26 Sep 2017 15:18:57 +0100 Subject: [PATCH] Just use Umbraco core logging, fixes #171 --- Helpers/LoggingHelper.cs | 4 --- UrlTracker.csproj | 1 - UrlTrackerErrorLogging.cs | 61 --------------------------------------- 3 files changed, 66 deletions(-) delete mode 100644 UrlTrackerErrorLogging.cs diff --git a/Helpers/LoggingHelper.cs b/Helpers/LoggingHelper.cs index 3d06cbe..12057f1 100644 --- a/Helpers/LoggingHelper.cs +++ b/Helpers/LoggingHelper.cs @@ -15,9 +15,7 @@ public static class LoggingHelper { public static void LogException(this Exception ex) { - LogManager.GetLogger(typeof(LoggingHelper)).Error(ex.Message, ex); LogHelper.Error(typeof(LoggingHelper), ex.Message, ex); - UrlTrackerLogging.Log(ex); } public static void LogInformation(string message, params object[] args) @@ -29,9 +27,7 @@ public static void LogInformation(string message) { if (UrlTrackerSettings.EnableLogging) { - LogManager.GetLogger(typeof(LoggingHelper)).Debug(message); LogHelper.Debug(typeof(LoggingHelper), () => { return message; }); - UrlTrackerLogging.Log(message); } } } diff --git a/UrlTracker.csproj b/UrlTracker.csproj index d60fff9..42d8f0c 100644 --- a/UrlTracker.csproj +++ b/UrlTracker.csproj @@ -237,7 +237,6 @@ - diff --git a/UrlTrackerErrorLogging.cs b/UrlTrackerErrorLogging.cs deleted file mode 100644 index 713664e..0000000 --- a/UrlTrackerErrorLogging.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace InfoCaster.Umbraco.UrlTracker -{ - /// - /// The Error Logger interface - /// - public interface IUrlTrackerLogger - { - /// - /// The Log method - /// - /// The error message - void Log(string message); - /// - /// The Log method - /// - /// The exception - void Log(Exception exception); - } - - /// - /// The Error Logging class - /// - public static class UrlTrackerLogging - { - /// - /// The active Error Logger instance - /// - internal static IUrlTrackerLogger ErrorLogger { get; set; } - /// - /// Registers the provided implemented as active ErrorLogger - /// - /// The implemented - public static void RegisterLogger(IUrlTrackerLogger logger) - { - ErrorLogger = logger; - } - /// - /// Log a message - /// - /// The message - internal static void Log(string message) - { - if (ErrorLogger != null) - ErrorLogger.Log(message); - } - /// - /// Log an - /// - /// The - internal static void Log(Exception exception) - { - if (ErrorLogger != null) - ErrorLogger.Log(exception); - } - } -}