Moves logging interface to Logging namespace called ILogger, creates a resolver for it, updates the boot process to ensure it exists first and anything during the boot process that is logging ensures that if it is not resolved that it logs elsewhere. Wraps LogHelper to use the ILogger based on the resolver. Updates all services that used LogHelper to have an ILogger injected into them. This is really only the start, there's a ton of places that use LogHelper (508) other places so we'll need to start looking at changing those over. All base classes will need to expose an Ilogger so people can use that.
This commit is contained in:
@@ -11,6 +11,13 @@ namespace Umbraco.Core.Profiling
|
||||
/// </summary>
|
||||
internal class LogProfiler : IProfiler
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public LogProfiler(ILogger logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public string Render()
|
||||
{
|
||||
return string.Empty;
|
||||
@@ -18,8 +25,8 @@ namespace Umbraco.Core.Profiling
|
||||
|
||||
public IDisposable Step(string name)
|
||||
{
|
||||
LogHelper.Debug(typeof(LogProfiler), "Starting - " + name);
|
||||
return DisposableTimer.Start(l => LogHelper.Info(typeof(LogProfiler), () => name + " (took " + l + "ms)"));
|
||||
_logger.Debug(typeof(LogProfiler), "Starting - " + name);
|
||||
return DisposableTimer.Start(l => _logger.Info(typeof(LogProfiler), () => name + " (took " + l + "ms)"));
|
||||
}
|
||||
|
||||
public void Start()
|
||||
|
||||
Reference in New Issue
Block a user