Exposes an ILogger property called Logger on all relevant base classes

This commit is contained in:
Shannon
2015-01-07 17:38:25 +11:00
parent 519b06fe30
commit 77e672aec1
9 changed files with 103 additions and 10 deletions

View File

@@ -3,6 +3,7 @@ using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
using Umbraco.Web.Security;
@@ -20,8 +21,16 @@ namespace Umbraco.Web.WebServices
}
protected UmbracoHttpHandler(UmbracoContext umbracoContext)
: this(LoggerResolver.Current.Logger, umbracoContext)
{
}
protected UmbracoHttpHandler(ILogger logger, UmbracoContext umbracoContext)
{
if (logger == null) throw new ArgumentNullException("logger");
if (umbracoContext == null) throw new ArgumentNullException("umbracoContext");
Logger = logger;
UmbracoContext = umbracoContext;
Umbraco = new UmbracoHelper(umbracoContext);
}
@@ -34,6 +43,8 @@ namespace Umbraco.Web.WebServices
get { return UmbracoContext.Application; }
}
public ILogger Logger { get; private set; }
/// <summary>
/// Returns the current UmbracoContext
/// </summary>