Remove a bunch of references to the old logger

This commit is contained in:
Mole
2020-09-21 09:52:58 +02:00
parent 894abdd183
commit ab3ac5ad91
76 changed files with 272 additions and 251 deletions

View File

@@ -8,6 +8,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.Configuration;
@@ -16,7 +17,6 @@ using Umbraco.Core.Dictionary;
using Umbraco.Core.Events;
using Umbraco.Core.Hosting;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models;
using Umbraco.Core.Models.ContentEditing;
@@ -62,9 +62,11 @@ namespace Umbraco.Web.BackOffice.Controllers
private readonly ISqlContext _sqlContext;
private readonly IContentTypeBaseServiceProvider _contentTypeBaseServiceProvider;
private readonly IRelationService _relationService;
private readonly ILogger<MediaController> _logger;
public MediaController(
ICultureDictionary cultureDictionary,
ILogger logger,
ILoggerFactory loggerFactory,
IShortStringHelper shortStringHelper,
IEventMessagesFactory eventMessages,
ILocalizedTextService localizedTextService,
@@ -81,7 +83,7 @@ namespace Umbraco.Web.BackOffice.Controllers
PropertyEditorCollection propertyEditors,
IMediaFileSystem mediaFileSystem,
IHostingEnvironment hostingEnvironment)
: base(cultureDictionary, logger, shortStringHelper, eventMessages, localizedTextService)
: base(cultureDictionary, loggerFactory, shortStringHelper, eventMessages, localizedTextService)
{
_shortStringHelper = shortStringHelper;
_contentSettings = contentSettings.Value;
@@ -98,6 +100,7 @@ namespace Umbraco.Web.BackOffice.Controllers
_propertyEditors = propertyEditors;
_mediaFileSystem = mediaFileSystem;
_hostingEnvironment = hostingEnvironment;
_logger = loggerFactory.CreateLogger<MediaController>();
}
/// <summary>
@@ -621,14 +624,14 @@ namespace Umbraco.Web.BackOffice.Controllers
// Save Media with new sort order and update content xml in db accordingly
if (mediaService.Sort(sortedMedia) == false)
{
Logger.LogWarning("Media sorting failed, this was probably caused by an event being cancelled");
_logger.LogWarning("Media sorting failed, this was probably caused by an event being cancelled");
throw HttpResponseException.CreateValidationErrorResponse("Media sorting failed, this was probably caused by an event being cancelled");
}
return Ok();
}
catch (Exception ex)
{
Logger.LogError(ex, "Could not update media sort order");
_logger.LogError(ex, "Could not update media sort order");
throw;
}
}