6 changed files with 31 additions and 13 deletions
@ -0,0 +1,7 @@ |
|||
namespace ApplicationCore.Interfaces |
|||
{ |
|||
public interface IAppLogger<T> |
|||
{ |
|||
void LogWarning(string message, params object[] args); |
|||
} |
|||
} |
|||
@ -1,16 +1,7 @@ |
|||
using ApplicationCore.Entities; |
|||
using Microsoft.eShopWeb.ApplicationCore.Entities; |
|||
using System.Security.Principal; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace ApplicationCore.Interfaces |
|||
namespace ApplicationCore.Interfaces |
|||
{ |
|||
|
|||
public interface IImageService |
|||
{ |
|||
byte[] GetImageBytesById(int id); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
@ -0,0 +1,18 @@ |
|||
using ApplicationCore.Interfaces; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace Infrastructure.Logging |
|||
{ |
|||
public class LoggerAdapter<T> : IAppLogger<T> |
|||
{ |
|||
private readonly ILogger<T> _logger; |
|||
public LoggerAdapter(ILoggerFactory loggerFactory) |
|||
{ |
|||
_logger = loggerFactory.CreateLogger<T>(); |
|||
} |
|||
public void LogWarning(string message, params object[] args) |
|||
{ |
|||
_logger.LogWarning(message, args); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue