Add CreateLogger method so we still can get types using the legacy ctor
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
|
||||
@@ -18,5 +19,10 @@ namespace Umbraco.Cms.Core
|
||||
{
|
||||
return _loggerFactory?.CreateLogger<T>() ?? NullLoggerFactory.Instance.CreateLogger<T>();
|
||||
}
|
||||
|
||||
public static ILogger CreateLogger(Type type)
|
||||
{
|
||||
return _loggerFactory?.CreateLogger(type) ?? NullLoggerFactory.Instance.CreateLogger(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,10 @@ namespace Umbraco.Cms.Infrastructure.HostedServices
|
||||
// Scheduled for removal in V11
|
||||
[Obsolete("Please use constructor that takes an ILogger instead")]
|
||||
protected RecurringHostedServiceBase(TimeSpan period, TimeSpan delay)
|
||||
: this(StaticApplicationLogging.CreateLogger<RecurringHostedServiceBase>(), period, delay)
|
||||
{
|
||||
_period = period;
|
||||
_delay = delay;
|
||||
_logger = StaticApplicationLogging.CreateLogger(GetType());
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
Reference in New Issue
Block a user