LoggerAdapter.cs 769 B

1234567891011121314151617181920212223242526272829
  1. using Microsoft.Extensions.Logging;
  2. using MTWorkHR.Core.Logging;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace MTWorkHR.Infrastructure.Logging
  9. {
  10. public class LoggerAdapter<T> : IAppLogger<T>
  11. {
  12. private readonly ILogger<T> _logger;
  13. public LoggerAdapter(ILoggerFactory loggerFactory)
  14. {
  15. _logger = loggerFactory.CreateLogger<T>();
  16. }
  17. public void LogInformation(string message, params object[] args)
  18. {
  19. _logger.LogInformation(message, args);
  20. }
  21. public void LogWarning(string message, params object[] args)
  22. {
  23. _logger.LogWarning(message, args);
  24. }
  25. }
  26. }