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:
24
src/Umbraco.Core/Logging/ILogger.cs
Normal file
24
src/Umbraco.Core/Logging/ILogger.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for logging service.
|
||||
/// </summary>
|
||||
public interface ILogger
|
||||
{
|
||||
void Error(Type callingType, string message, Exception exception);
|
||||
|
||||
void Warn(Type callingType, string message, params Func<object>[] formatItems);
|
||||
|
||||
void WarnWithException(Type callingType, string message, Exception e, params Func<object>[] formatItems);
|
||||
|
||||
void Info(Type callingType, Func<string> generateMessage);
|
||||
|
||||
void Info(Type type, string generateMessageFormat, params Func<object>[] formatItems);
|
||||
|
||||
void Debug(Type callingType, Func<string> generateMessage);
|
||||
|
||||
void Debug(Type type, string generateMessageFormat, params Func<object>[] formatItems);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user