forked from dotnet-architecture/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit tests working; added logger adapter.
- Loading branch information
Showing
6 changed files
with
31 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace ApplicationCore.Interfaces | ||
{ | ||
public interface IAppLogger<T> | ||
{ | ||
void LogWarning(string message, params object[] args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters